aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2022-04-05 21:03:18 +0200
committerUros Bizjak <ubizjak@gmail.com>2022-04-05 21:04:13 +0200
commitcbc9dd66484a51d450f78ab748a872b939c90c3f (patch)
treecc250d2b11799173b1e6d08ea580064160b1db36
parent892c7f03ae63121766a8be48f7e3b672547fd627 (diff)
downloadgcc-cbc9dd66484a51d450f78ab748a872b939c90c3f.zip
gcc-cbc9dd66484a51d450f78ab748a872b939c90c3f.tar.gz
gcc-cbc9dd66484a51d450f78ab748a872b939c90c3f.tar.bz2
i386: Fix movv2qi_internal xmm reg to xmm reg move for AVX512FP16 [PR105139]
2022-04-05 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/105139 * config/i386/mmx.md (*movv2qi_internal): Change insn mode of alternative 5 to HF for TARGET_AVX512FP16. gcc/testsuite/ChangeLog: PR target/105139 * gcc.target/i386/pr105139.c: New test.
-rw-r--r--gcc/config/i386/mmx.md2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr105139.c17
2 files changed, 18 insertions, 1 deletions
diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
index 29d470b..197f19e 100644
--- a/gcc/config/i386/mmx.md
+++ b/gcc/config/i386/mmx.md
@@ -462,7 +462,7 @@
(const_string "TI"))
(eq_attr "alternative" "5")
(cond [(match_test "TARGET_AVX512FP16")
- (const_string "HI")
+ (const_string "HF")
(match_test "TARGET_AVX")
(const_string "TI")
(ior (not (match_test "TARGET_SSE2"))
diff --git a/gcc/testsuite/gcc.target/i386/pr105139.c b/gcc/testsuite/gcc.target/i386/pr105139.c
new file mode 100644
index 0000000..06e4797
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr105139.c
@@ -0,0 +1,17 @@
+/* { dg-do assemble { target avx512fp16 } } */
+/* { dg-options "-O3 -march=sapphirerapids" } */
+
+extern long c[];
+extern int d[];
+long a;
+
+long e (long f)
+{
+ return f < a ? f : a;
+}
+
+void g (void)
+{
+ for (signed b = 0; b < 4028643; b++)
+ d[b] = e ((char) (~c[b]));
+}