]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386: Enable *rsqrtsf2_sse without TARGET_SSE_MATH [PR117357]
authorUros Bizjak <ubizjak@gmail.com>
Mon, 18 Nov 2024 21:38:46 +0000 (22:38 +0100)
committerUros Bizjak <ubizjak@gmail.com>
Mon, 18 Nov 2024 21:38:46 +0000 (22:38 +0100)
__builtin_ia32_rsqrtsf2 expander generates UNSPEC_RSQRT insn pattern
also when TARGET_SSE_MATH is not set.  Enable *rsqrtsf2_sse without
TARGET_SSE_MATH to avoid ICE with unrecognizable insn.

PR target/117357

gcc/ChangeLog:

* config/i386/i386.md (*rsqrtsf2_sse):
Also enable for !TARGET_SSE_MATH.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr117357.c: New test.

gcc/config/i386/i386.md
gcc/testsuite/gcc.target/i386/pr117357.c [new file with mode: 0644]

index 03b0f548467eac2729d9feb0f95897c177412b90..b2209492fa0eda34b0eb3e6096cb641cbb646997 100644 (file)
   [(set (match_operand:SF 0 "register_operand" "=x,x,x,x")
        (unspec:SF [(match_operand:SF 1 "nonimmediate_operand" "0,x,m,ja")]
                   UNSPEC_RSQRT))]
-  "TARGET_SSE && TARGET_SSE_MATH"
+  "TARGET_SSE"
   "@
    %vrsqrtss\t{%d1, %0|%0, %d1}
    %vrsqrtss\t{%d1, %0|%0, %d1}
diff --git a/gcc/testsuite/gcc.target/i386/pr117357.c b/gcc/testsuite/gcc.target/i386/pr117357.c
new file mode 100644 (file)
index 0000000..7a27691
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-msse -mfpmath=387" } */
+
+float foo (float f)
+{
+  return __builtin_ia32_rsqrtf (f);
+}