When adding LoongArch32 ilp32s abi support, add TARGET_HARD_FLOAT condition for
movsf to prevent matching in target without FPU.
But movsf also needs to be used in lp64s abi, it can expand to some
non float instructions.
Delete TARGET_HARD_FLOAT condition.
gcc/ChangeLog:
* config/loongarch/loongarch.md: Delete movsf TARGET_HARD_FLOAT
condition.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/la64/movsf.c: New test.
(define_expand "movsf"
[(set (match_operand:SF 0 "")
(match_operand:SF 1 ""))]
- "TARGET_HARD_FLOAT"
+ ""
{
if (loongarch_legitimize_move (SFmode, operands[0], operands[1]))
DONE;
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-mabi=lp64s" } */
+
+float
+__powisf2 (float x, int m)
+{
+ unsigned int n = m < 0 ? -(unsigned int) m : (unsigned int) m;
+ float y = n % 2 ? x : 1;
+ while (n >>= 1)
+ {
+ x = x * x;
+ if (n % 2)
+ y = y * x;
+ }
+ return m < 0 ? 1/y : y;
+}