From aadd9a6e26915538eb1417c36c43739b09acfe48 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 17 Apr 2019 21:23:45 +0200 Subject: [PATCH] re PR target/90125 (Typo of AVX512 intrinsics) 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 --- gcc/ChangeLog | 9 +++++++++ gcc/config/i386/avx512fintrin.h | 16 ++++++++-------- gcc/testsuite/ChangeLog | 15 +++++++++++++++ .../gcc.target/i386/avx512f-vfmaddXXXsd-3.c | 5 +++++ .../gcc.target/i386/avx512f-vfmaddXXXss-3.c | 5 +++++ .../gcc.target/i386/avx512f-vfmsubXXXsd-3.c | 5 +++++ .../gcc.target/i386/avx512f-vfmsubXXXss-2.c | 4 ++-- .../gcc.target/i386/avx512f-vfmsubXXXss-3.c | 5 +++++ .../gcc.target/i386/avx512f-vfnmaddXXXsd-3.c | 5 +++++ .../gcc.target/i386/avx512f-vfnmaddXXXss-2.c | 4 ++-- .../gcc.target/i386/avx512f-vfnmaddXXXss-3.c | 5 +++++ .../gcc.target/i386/avx512f-vfnmsubXXXsd-3.c | 5 +++++ .../gcc.target/i386/avx512f-vfnmsubXXXss-3.c | 5 +++++ 13 files changed, 76 insertions(+), 12 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/avx512f-vfmaddXXXsd-3.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512f-vfmaddXXXss-3.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXsd-3.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXss-3.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXsd-3.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXss-3.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512f-vfnmsubXXXsd-3.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512f-vfnmsubXXXss-3.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3b01ff7cbf6..4744dd296fd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2019-04-17 Hongtao Liu + + 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 * ira-conflicts.c (print_allocno_conflicts): Always print something, diff --git a/gcc/config/i386/avx512fintrin.h b/gcc/config/i386/avx512fintrin.h index afcba5dd042..e35eedb9268 100644 --- a/gcc/config/i386/avx512fintrin.h +++ b/gcc/config/i386/avx512fintrin.h @@ -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__ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e9e007769cf..963245e96ad 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,18 @@ +2019-04-17 Jakub Jelinek + + 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 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 index 00000000000..8ad05b85fe1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-vfmaddXXXsd-3.c @@ -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 index 00000000000..b3738164d61 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-vfmaddXXXss-3.c @@ -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 index 00000000000..ed10e18d8f0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXsd-3.c @@ -0,0 +1,5 @@ +/* { dg-do run } */ +/* { dg-options "-O0 -mavx512f" } */ +/* { dg-require-effective-target avx512f } */ + +#include "avx512f-vfmsubXXXsd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXss-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXss-2.c index 6beaed87898..cd3131f165b 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXss-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXss-2.c @@ -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 index 00000000000..d1b268e9a53 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-vfmsubXXXss-3.c @@ -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 index 00000000000..70b47f7fd14 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXsd-3.c @@ -0,0 +1,5 @@ +/* { dg-do run } */ +/* { dg-options "-O0 -mavx512f" } */ +/* { dg-require-effective-target avx512f } */ + +#include "avx512f-vfnmaddXXXsd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXss-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXss-2.c index e94b7d4aed4..aad28c4db40 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXss-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXss-2.c @@ -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 index 00000000000..ab352a2d9ba --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-vfnmaddXXXss-3.c @@ -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 index 00000000000..f454094b5a1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-vfnmsubXXXsd-3.c @@ -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 index 00000000000..dcc1a8f0401 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-vfnmsubXXXss-3.c @@ -0,0 +1,5 @@ +/* { dg-do run } */ +/* { dg-options "-O0 -mavx512f" } */ +/* { dg-require-effective-target avx512f } */ + +#include "avx512f-vfnmsubXXXss-2.c" -- 2.30.2