diff mbox series

[x86] Use x instead of v for alternative 2 (v, BH) in mov<mode>_internal.

Message ID 20230614014755.634006-1-hongtao.liu@intel.com
State New
Headers show
Series [x86] Use x instead of v for alternative 2 (v, BH) in mov<mode>_internal. | expand

Commit Message

liuhongt June 14, 2023, 1:47 a.m. UTC
Since there's no evex version for vpcmpeq ymm, ymm, ymm.

Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
Ready to push to trunk and backport to GCC13.

gcc/ChangeLog:

	PR target/110227
	* config/i386/sse.md (mov<mode>_internal>): Use x instead of v
	for alternative 2 since there's no evex version for vpcmpeqd
	ymm, ymm, ymm.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr110227.c: New test.
---
 gcc/config/i386/sse.md                   |  2 +-
 gcc/testsuite/gcc.target/i386/pr110227.c | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr110227.c
diff mbox series

Patch

diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 9bec09d354a..370ea6418a6 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -1324,7 +1324,7 @@  (define_expand "mov<mode>"
 
 (define_insn "mov<mode>_internal"
   [(set (match_operand:VMOVE 0 "nonimmediate_operand"
-	 "=v,v ,v,v ,m")
+	 "=v,v ,x,v ,m")
 	(match_operand:VMOVE 1 "nonimmediate_or_sse_const_operand"
 	 " C,<sseconstm1>,BH,vm,v"))]
   "TARGET_SSE
diff --git a/gcc/testsuite/gcc.target/i386/pr110227.c b/gcc/testsuite/gcc.target/i386/pr110227.c
new file mode 100644
index 00000000000..9b59f5b6e49
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr110227.c
@@ -0,0 +1,11 @@ 
+/* { dg-do assemble { target { ! ia32 } } } */
+/* { dg-options " -O2 -mavx512vl" } */
+
+#include <immintrin.h>
+
+void f()
+{
+  __m256i mask = _mm256_set_epi32(0, 0, 0, 0, -1, -1, -1, -1);
+  register __m256i reg asm("xmm16") = mask;
+  asm(""::"v"(reg));
+}