aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2024-11-18 22:38:46 +0100
committerUros Bizjak <ubizjak@gmail.com>2024-11-18 22:38:46 +0100
commit344356f781ddb7bf0abb11edf9bdd13f6802dea8 (patch)
treebf4d9c75c5e8d42785971f80172f6f21fc06e4e1
parenta3098b9a7281adef2028c2be3674094697557c2c (diff)
downloadgcc-344356f781ddb7bf0abb11edf9bdd13f6802dea8.zip
gcc-344356f781ddb7bf0abb11edf9bdd13f6802dea8.tar.gz
gcc-344356f781ddb7bf0abb11edf9bdd13f6802dea8.tar.bz2
i386: Enable *rsqrtsf2_sse without TARGET_SSE_MATH [PR117357]
__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.
-rw-r--r--gcc/config/i386/i386.md2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr117357.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 03b0f54..b220949 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -23364,7 +23364,7 @@
[(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
index 0000000..7a27691
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr117357.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-msse -mfpmath=387" } */
+
+float foo (float f)
+{
+ return __builtin_ia32_rsqrtf (f);
+}