re PR target/90125 (Typo of AVX512 intrinsics)
authorJakub Jelinek <jakub@gcc.gnu.org>
Wed, 17 Apr 2019 19:23:45 +0000 (21:23 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 17 Apr 2019 19:23:45 +0000 (21:23 +0200)
PR target/90125
* config/i386/avx512fintrin.h (_mm_maskz_fmadd_round_sd,
_mm_maskz_fmadd_round_ss, _mm_maskz_fmsub_round_sd,
_mm_maskz_fmsub_round_ss, _mm_maskz_fnmadd_round_sd,
_mm_maskz_fnmadd_round_ss, _mm_maskz_fnmsub_round_sd,
_mm_maskz_fnmsub_round_ss): Use _maskz builtin instead of _mask3.

PR target/90125
* gcc.target/i386/avx512f-vfmsubXXXss-2.c (avx512f_test): Adjust
constants to ensure precise result even when not using fma.
* gcc.target/i386/avx512f-vfnmaddXXXss-2.c (avx512f_test): Likewise.
* gcc.target/i386/avx512f-vfmaddXXXsd-3.c: New test.
* gcc.target/i386/avx512f-vfmaddXXXss-3.c: New test.
* gcc.target/i386/avx512f-vfmsubXXXsd-3.c: New test.
* gcc.target/i386/avx512f-vfmsubXXXss-3.c: New test.
* gcc.target/i386/avx512f-vfnmaddXXXsd-3.c: New test.
* gcc.target/i386/avx512f-vfnmaddXXXss-3.c: New test.
* gcc.target/i386/avx512f-vfnmsubXXXsd-3.c: New test.
* gcc.target/i386/avx512f-vfnmsubXXXss-3.c: New test.

From-SVN: r270421

13 files changed:
gcc/ChangeLog
gcc/config/i386/avx512fintrin.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/avx512f-vfmaddXXXsd-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-vfmaddXXXss-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXsd-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXss-2.c
gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXss-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXsd-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXss-2.c
gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXss-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-vfnmsubXXXsd-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-vfnmsubXXXss-3.c [new file with mode: 0644]

index 3b01ff7cbf69383f52466fe126b26125b3ed801a..4744dd296fdf49da9f4d73d36045dd2bb0902e55 100644 (file)
@@ -1,3 +1,12 @@
+2019-04-17  Hongtao Liu  <hongtao.liu@intel.com>
+
+       PR target/90125
+       * config/i386/avx512fintrin.h (_mm_maskz_fmadd_round_sd,
+       _mm_maskz_fmadd_round_ss, _mm_maskz_fmsub_round_sd,
+       _mm_maskz_fmsub_round_ss, _mm_maskz_fnmadd_round_sd,
+       _mm_maskz_fnmadd_round_ss, _mm_maskz_fnmsub_round_sd,
+       _mm_maskz_fnmsub_round_ss): Use _maskz builtin instead of _mask3.
+
 2019-04-17  Peter Bergner  <bergner@linux.ibm.com>
 
        * ira-conflicts.c (print_allocno_conflicts): Always print something,
index afcba5dd0420cd0c0bb342c83b4078d16e957f20..e35eedb9268d1b8c2ad4b5128281edba6e4e1eb1 100644 (file)
@@ -12104,10 +12104,10 @@ _mm_maskz_fnmsub_round_ss (__mmask8 __U, __m128 __W, __m128 __A, __m128 __B,
     (__m128) __builtin_ia32_vfmaddss3_mask3 (A, B, C, U, R)
 
 #define _mm_maskz_fmadd_round_sd(U, A, B, C, R)            \
-    (__m128d) __builtin_ia32_vfmaddsd3_mask3 (A, B, C, U, R)
+    (__m128d) __builtin_ia32_vfmaddsd3_maskz (A, B, C, U, R)
 
 #define _mm_maskz_fmadd_round_ss(U, A, B, C, R)            \
-    (__m128) __builtin_ia32_vfmaddss3_mask3 (A, B, C, U, R)
+    (__m128) __builtin_ia32_vfmaddss3_maskz (A, B, C, U, R)
 
 #define _mm_mask_fmsub_round_sd(A, U, B, C, R)            \
     (__m128d) __builtin_ia32_vfmaddsd3_mask (A, B, -(C), U, R)
@@ -12122,10 +12122,10 @@ _mm_maskz_fnmsub_round_ss (__mmask8 __U, __m128 __W, __m128 __A, __m128 __B,
     (__m128) __builtin_ia32_vfmsubss3_mask3 (A, B, C, U, R)
 
 #define _mm_maskz_fmsub_round_sd(U, A, B, C, R)            \
-    (__m128d) __builtin_ia32_vfmaddsd3_mask3 (A, B, -(C), U, R)
+    (__m128d) __builtin_ia32_vfmaddsd3_maskz (A, B, -(C), U, R)
 
 #define _mm_maskz_fmsub_round_ss(U, A, B, C, R)            \
-    (__m128) __builtin_ia32_vfmaddss3_mask3 (A, B, -(C), U, R)
+    (__m128) __builtin_ia32_vfmaddss3_maskz (A, B, -(C), U, R)
 
 #define _mm_mask_fnmadd_round_sd(A, U, B, C, R)            \
     (__m128d) __builtin_ia32_vfmaddsd3_mask (A, -(B), C, U, R)
@@ -12140,10 +12140,10 @@ _mm_maskz_fnmsub_round_ss (__mmask8 __U, __m128 __W, __m128 __A, __m128 __B,
     (__m128) __builtin_ia32_vfmaddss3_mask3 (A, -(B), C, U, R)
 
 #define _mm_maskz_fnmadd_round_sd(U, A, B, C, R)            \
-    (__m128d) __builtin_ia32_vfmaddsd3_mask3 (A, -(B), C, U, R)
+    (__m128d) __builtin_ia32_vfmaddsd3_maskz (A, -(B), C, U, R)
 
 #define _mm_maskz_fnmadd_round_ss(U, A, B, C, R)            \
-    (__m128) __builtin_ia32_vfmaddss3_mask3 (A, -(B), C, U, R)
+    (__m128) __builtin_ia32_vfmaddss3_maskz (A, -(B), C, U, R)
 
 #define _mm_mask_fnmsub_round_sd(A, U, B, C, R)            \
     (__m128d) __builtin_ia32_vfmaddsd3_mask (A, -(B), -(C), U, R)
@@ -12158,10 +12158,10 @@ _mm_maskz_fnmsub_round_ss (__mmask8 __U, __m128 __W, __m128 __A, __m128 __B,
     (__m128) __builtin_ia32_vfmsubss3_mask3 (A, -(B), C, U, R)
 
 #define _mm_maskz_fnmsub_round_sd(U, A, B, C, R)            \
-    (__m128d) __builtin_ia32_vfmaddsd3_mask3 (A, -(B), -(C), U, R)
+    (__m128d) __builtin_ia32_vfmaddsd3_maskz (A, -(B), -(C), U, R)
 
 #define _mm_maskz_fnmsub_round_ss(U, A, B, C, R)            \
-    (__m128) __builtin_ia32_vfmaddss3_mask3 (A, -(B), -(C), U, R)
+    (__m128) __builtin_ia32_vfmaddss3_maskz (A, -(B), -(C), U, R)
 #endif
 
 #ifdef __OPTIMIZE__
index e9e007769cf6d4409917aaf7f4bfff79a79f7491..963245e96adaa6498570b47653da807f3abb8a24 100644 (file)
@@ -1,3 +1,18 @@
+2019-04-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/90125
+       * gcc.target/i386/avx512f-vfmsubXXXss-2.c (avx512f_test): Adjust
+       constants to ensure precise result even when not using fma.
+       * gcc.target/i386/avx512f-vfnmaddXXXss-2.c (avx512f_test): Likewise.
+       * gcc.target/i386/avx512f-vfmaddXXXsd-3.c: New test.
+       * gcc.target/i386/avx512f-vfmaddXXXss-3.c: New test.
+       * gcc.target/i386/avx512f-vfmsubXXXsd-3.c: New test.
+       * gcc.target/i386/avx512f-vfmsubXXXss-3.c: New test.
+       * gcc.target/i386/avx512f-vfnmaddXXXsd-3.c: New test.
+       * gcc.target/i386/avx512f-vfnmaddXXXss-3.c: New test.
+       * gcc.target/i386/avx512f-vfnmsubXXXsd-3.c: New test.
+       * gcc.target/i386/avx512f-vfnmsubXXXss-3.c: New test.
+
 2019-04-17  Marek Polacek  <polacek@redhat.com>
 
        PR c++/90124 - bogus error with incomplete type in decltype.
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vfmaddXXXsd-3.c b/gcc/testsuite/gcc.target/i386/avx512f-vfmaddXXXsd-3.c
new file mode 100644 (file)
index 0000000..8ad05b8
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-options "-O0 -mavx512f" } */
+/* { dg-require-effective-target avx512f } */
+
+#include "avx512f-vfmaddXXXsd-2.c"
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vfmaddXXXss-3.c b/gcc/testsuite/gcc.target/i386/avx512f-vfmaddXXXss-3.c
new file mode 100644 (file)
index 0000000..b373816
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-options "-O0 -mavx512f" } */
+/* { dg-require-effective-target avx512f } */
+
+#include "avx512f-vfmaddXXXss-2.c"
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXsd-3.c b/gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXsd-3.c
new file mode 100644 (file)
index 0000000..ed10e18
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-options "-O0 -mavx512f" } */
+/* { dg-require-effective-target avx512f } */
+
+#include "avx512f-vfmsubXXXsd-2.c"
index 6beaed87898f8e5ad52d373fe1f72ffbdd7a626f..cd3131f165b8645971b5712d340fb33f13b524db 100644 (file)
@@ -41,8 +41,8 @@ avx512f_test (void)
   for (i = 0; i < SIZE; i++)
     {
       src1.a[i] = DEFAULT_VALUE;
-      src2.a[i] = 56.78 * (i + 1) * sign;
-      src3.a[i] = 90.12 * (i + 2) * sign;
+      src2.a[i] = 56.75 * (i + 1) * sign;
+      src3.a[i] = 90.25 * (i + 2) * sign;
       sign = sign * -1;
     }
   for (i = 0; i < SIZE; i++)
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXss-3.c b/gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXss-3.c
new file mode 100644 (file)
index 0000000..d1b268e
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-options "-O0 -mavx512f" } */
+/* { dg-require-effective-target avx512f } */
+
+#include "avx512f-vfmsubXXXss-2.c"
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXsd-3.c b/gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXsd-3.c
new file mode 100644 (file)
index 0000000..70b47f7
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-options "-O0 -mavx512f" } */
+/* { dg-require-effective-target avx512f } */
+
+#include "avx512f-vfnmaddXXXsd-2.c"
index e94b7d4aed4aa635f61558f7e9854c19cbeee4d8..aad28c4db40b77ba30a475c0ff69ff0ef2a4b7b7 100644 (file)
@@ -41,8 +41,8 @@ avx512f_test (void)
   for (i = 0; i < SIZE; i++)
     {
       src1.a[i] = DEFAULT_VALUE;
-      src2.a[i] = 56.78 * (i + 1) * sign;
-      src3.a[i] = 90.12 * (i + 2) * sign;
+      src2.a[i] = 56.75 * (i + 1) * sign;
+      src3.a[i] = 90.25 * (i + 2) * sign;
       sign = sign * -1;
     }
   for (i = 0; i < SIZE; i++)
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXss-3.c b/gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXss-3.c
new file mode 100644 (file)
index 0000000..ab352a2
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-options "-O0 -mavx512f" } */
+/* { dg-require-effective-target avx512f } */
+
+#include "avx512f-vfnmaddXXXss-2.c"
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vfnmsubXXXsd-3.c b/gcc/testsuite/gcc.target/i386/avx512f-vfnmsubXXXsd-3.c
new file mode 100644 (file)
index 0000000..f454094
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-options "-O0 -mavx512f" } */
+/* { dg-require-effective-target avx512f } */
+
+#include "avx512f-vfnmsubXXXsd-2.c"
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vfnmsubXXXss-3.c b/gcc/testsuite/gcc.target/i386/avx512f-vfnmsubXXXss-3.c
new file mode 100644 (file)
index 0000000..dcc1a8f
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-options "-O0 -mavx512f" } */
+/* { dg-require-effective-target avx512f } */
+
+#include "avx512f-vfnmsubXXXss-2.c"