]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix typo in <code>v1ti3.
authorliuhongt <hongtao.liu@intel.com>
Wed, 23 Feb 2022 06:32:29 +0000 (14:32 +0800)
committerliuhongt <hongtao.liu@intel.com>
Thu, 24 Feb 2022 01:05:10 +0000 (09:05 +0800)
For evex encoding vp{xor,or,and}, suffix is needed.

Or there would be an error for
vpxor %xmm0, %xmm31, %xmm1

Error: unsupported instruction `vpxor'

gcc/ChangeLog:

* config/i386/sse.md (<code>v1ti3): Add suffix and replace
isa attr of alternative 2 from avx to avx512vl.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx512vl-logicsuffix-1.c: New test.

gcc/config/i386/sse.md
gcc/testsuite/gcc.target/i386/avx512vl-logicsuffix-1.c [new file with mode: 0644]

index b2f56345c6504ffe07c80227b466c5be4283208d..3066ea3734ad058b41c39f8a1523f369d90bc2d4 100644 (file)
   "@
    p<logic>\t{%2, %0|%0, %2}
    vp<logic>\t{%2, %1, %0|%0, %1, %2}
-   vp<logic>\t{%2, %1, %0|%0, %1, %2}"
-  [(set_attr "isa" "noavx,avx,avx")
+   vp<logic>d\t{%2, %1, %0|%0, %1, %2}"
+  [(set_attr "isa" "noavx,avx,avx512vl")
    (set_attr "prefix" "orig,vex,evex")
    (set_attr "prefix_data16" "1,*,*")
    (set_attr "type" "sselog")
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-logicsuffix-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-logicsuffix-1.c
new file mode 100644 (file)
index 0000000..4ec5b2a
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do assemble { target { int128 && avx512vl } } } */
+/* { dg-options "-O2 -mavx512vl" } */
+
+typedef __int128 V __attribute__((vector_size (16)));
+
+void
+foo (V *x, V *y, V *z)
+{
+  register V a __asm ("xmm31") = *z;
+  __asm ("" : "+v" (a));
+  x[0] = y[0] & a;
+  x[1] = y[1] | a;
+  x[2] = y[2] ^ a;
+}