i386: Fix up vector mul and div with broadcasts in -masm=intel mode
authorJakub Jelinek <jakub@redhat.com>
Tue, 15 Sep 2020 07:37:48 +0000 (09:37 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 15 Sep 2020 07:39:38 +0000 (09:39 +0200)
These patterns printed bogus <>s around the {1to16} and similar strings.

2020-09-15  Jakub Jelinek  <jakub@redhat.com>

PR target/97028
* config/i386/sse.md (mul<mode>3<mask_name>_bcs,
<avx512>_div<mode>3<mask_name>_bcst): Use <avx512bcst> instead of
<<avx512bcst>>.

* gcc.target/i386/avx512f-pr97028.c: Untested fix.

gcc/config/i386/sse.md
gcc/testsuite/gcc.target/i386/avx512f-pr97028.c [new file with mode: 0644]

index a784346a23b946bd8c7727f45ede46b7d1132305..934b60a288fbd0d3f53ac8595c2da4b922ad85f4 100644 (file)
             (match_operand:<ssescalarmode> 1 "memory_operand" "m"))
          (match_operand:VF_AVX512 2 "register_operand" "v")))]
   "TARGET_AVX512F && <mask_mode512bit_condition>"
-  "vmul<ssemodesuffix>\t{%1<avx512bcst>, %2, %0<mask_operand3>|%0<mask_operand3>, %2, %1<<avx512bcst>>}"
+  "vmul<ssemodesuffix>\t{%1<avx512bcst>, %2, %0<mask_operand3>|%0<mask_operand3>, %2, %1<avx512bcst>}"
   [(set_attr "prefix" "evex")
    (set_attr "type" "ssemul")
    (set_attr "mode" "<MODE>")])
          (vec_duplicate:VF_AVX512
             (match_operand:<ssescalarmode> 2 "memory_operand" "m"))))]
   "TARGET_AVX512F && <mask_mode512bit_condition>"
-  "vdiv<ssemodesuffix>\t{%2<avx512bcst>, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2<<avx512bcst>>}"
+  "vdiv<ssemodesuffix>\t{%2<avx512bcst>, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2<avx512bcst>}"
   [(set_attr "prefix" "evex")
     (set_attr "type" "ssediv")
    (set_attr "mode" "<MODE>")])
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr97028.c b/gcc/testsuite/gcc.target/i386/avx512f-pr97028.c
new file mode 100644 (file)
index 0000000..2719108
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR target/97028 */
+/* { dg-do assemble { target avx512f } } */
+/* { dg-require-effective-target masm_intel } */
+/* { dg-options "-O2 -mavx512f -masm=intel" } */
+
+#include <x86intrin.h>
+
+__m512
+foo (__m512 x, float *y)
+{
+  return _mm512_mul_ps (x, _mm512_set1_ps (*y));
+}
+
+__m512
+bar (__m512 x, float *y)
+{
+  return _mm512_div_ps (x, _mm512_set1_ps (*y));
+}