AVX512FP16: Fix masm=intel output for vfc?(madd|mul)csh [PR 104977]
authorHongyu Wang <hongyu.wang@intel.com>
Fri, 18 Mar 2022 15:47:35 +0000 (23:47 +0800)
committerHongyu Wang <hongyu.wang@intel.com>
Mon, 21 Mar 2022 01:08:10 +0000 (09:08 +0800)
Fix typo in subst for scalar complex mask_round operand.

gcc/ChangeLog:

PR target/104977
* config/i386/sse.md
(avx512fp16_fma<complexopname>sh_v8hf<mask_scalarcz_name><round_scalarcz_name>):
Correct round operand for intel dialect.

gcc/testsuite/ChangeLog:

PR target/104977
* gcc.target/i386/pr104977.c: New test.

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

index ed98120..21bf3c5 100644 (file)
          (match_dup 2)
          (const_int 3)))]
   "TARGET_AVX512FP16"
-  "v<complexopname>sh\t{<round_scalarcz_mask_op4>%2, %1, %0<mask_scalarcz_operand4>|%0<mask_scalarcz_operand4>, %1, %2<round_scalarcz_maskcz_mask_op4>}"
+  "v<complexopname>sh\t{<round_scalarcz_mask_op4>%2, %1, %0<mask_scalarcz_operand4>|%0<mask_scalarcz_operand4>, %1, %2<round_scalarcz_mask_op4>}"
   [(set_attr "type" "ssemuladd")
    (set_attr "mode" "V8HF")])
 
diff --git a/gcc/testsuite/gcc.target/i386/pr104977.c b/gcc/testsuite/gcc.target/i386/pr104977.c
new file mode 100644 (file)
index 0000000..9faa4db
--- /dev/null
@@ -0,0 +1,13 @@
+/* PR target/104977 */
+/* { dg-do assemble } */
+/* { dg-options "-O2 -mavx512fp16 -masm=intel" } */
+/* { dg-require-effective-target avx512fp16 } */
+/* { dg-require-effective-target masm_intel } */
+
+#include<immintrin.h>
+
+__m128h
+foo (__m128h a, __m128h b, __m128h c, __mmask8 m)
+{
+  return _mm_fcmadd_round_sch (a, b, c, 8);
+}