From 68d872d728caced187cfef59c8a5a04af34b2c64 Mon Sep 17 00:00:00 2001 From: Sebastian Peryt Date: Thu, 6 Jul 2017 13:52:05 +0200 Subject: [PATCH] Add missing intrinsics for VGETMANT[SD,SS] and VGETEXP[SD,SS] gcc/ * config/i386/avx512fintrin.h (_mm_mask_getexp_round_ss, _mm_maskz_getexp_round_ss, _mm_mask_getexp_round_sd, _mm_maskz_getexp_round_sd, _mm_mask_getmant_round_sd, _mm_maskz_getmant_round_sd, _mm_mask_getmant_round_ss, _mm_maskz_getmant_round_ss, _mm_mask_getexp_ss, _mm_maskz_getexp_ss, _mm_mask_getexp_sd, _mm_maskz_getexp_sd, _mm_mask_getmant_sd, _mm_maskz_getmant_sd, _mm_mask_getmant_ss, _mm_maskz_getmant_ss): New intrinsics. (__builtin_ia32_getexpss128_mask): Changed to ... __builtin_ia32_getexpss128_round ... this. (__builtin_ia32_getexpsd128_mask): Changed to ... __builtin_ia32_getexpsd128_round ... this. * config/i386/i386-builtin-types.def ((V2DF, V2DF, V2DF, INT, V2DF, UQI, INT), (V4SF, V4SF, V4SF, INT, V4SF, UQI, INT)): New function type aliases. * config/i386/i386-builtin.def (__builtin_ia32_getexpsd_mask_round, __builtin_ia32_getexpss_mask_round, __builtin_ia32_getmantsd_mask_round, __builtin_ia32_getmantss_mask_round): New builtins. * config/i386/i386.c (V2DF_FTYPE_V2DF_V2DF_INT_V2DF_UQI_INT, V4SF_FTYPE_V4SF_V4SF_INT_V4SF_UQI_INT): Handle new types. (CODE_FOR_avx512f_vgetmantv2df_mask_round, CODE_FOR_avx512f_vgetmantv4sf_mask_round): New cases. * config/i386/sse.md (avx512f_sgetexp): Changed to ... avx512f_sgetexp ... this. (vgetexp\t{%2, %1, %0| %0, %1, %2}): Changed to ... vgetexp \t{%2, %1, %0| %0, %1, %2} ... this. (avx512f_vgetmant): Changed to ... avx512f_vgetmant ... this. (vgetmant\t{%3, %2, %1, %0| %0, %1, %2, %3}): Changed to ... vgetmant \t{%3, %2, %1, %0| %0, %1, %2 , %3} ... this. * config/i386/subst.md (mask_scalar_operand4, round_saeonly_scalar_mask_operand4, round_saeonly_scalar_mask_op4, round_saeonly_scalar_nimm_predicate): New subst attributes. gcc/testsuite/ * gcc.target/i386/avx512f-vgetexpsd-1.c (_mm_mask_getexp_sd, _mm_maskz_getexp_sd, _mm_mask_getexp_round_sd, _mm_maskz_getexp_round_sd): Test new intrinsics. * gcc.target/i386/avx512f-vgetexpss-1.c (_mm_mask_getexp_ss, _mm_maskz_getexp_ss, _mm_mask_getexp_round_ss, _mm_maskz_getexp_round_ss): Ditto. * gcc.target/i386/avx512f-vgetmantsd-1.c (_mm_mask_getmant_sd, _mm_maskz_getmant_sd, _mm_mask_getmant_round_sd, _mm_maskz_getmant_round_sd): Ditto. * gcc.target/i386/avx512f-vgetmantss-1.c (_mm_mask_getmant_ss, _mm_maskz_getmant_ss, _mm_mask_getmant_round_ss, _mm_maskz_getmant_round_ss): Ditto. * gcc.target/i386/avx512f-vgetexpsd-2.c (_mm_mask_getexp_sd, _mm_maskz_getexp_sd, _mm_getexp_round_sd, _mm_mask_getexp_round_sd, _mm_maskz_getexp_round_sd): New runtime tests. * gcc.target/i386/avx512f-vgetexpss-2.c (_mm_mask_getexp_ss, _mm_maskz_getexp_ss, _mm_getexp_round_ss, _mm_mask_getexp_round_ss, _mm_maskz_getexp_round_ss): Ditto. * gcc.target/i386/avx512f-vgetmantsd-2.c (_mm_mask_getmant_sd, _mm_maskz_getmant_sd, _mm_getmant_round_sd, _mm_mask_getmant_round_sd, _mm_maskz_getmant_round_sd): Ditto. * gcc.target/i386/avx512f-vgetmantss-2.c (_mm_mask_getmant_ss, _mm_maskz_getmant_ss, _mm_getmant_round_ss, _mm_mask_getmant_round_ss, _mm_maskz_getmant_round_ss): Ditto. * gcc.target/i386/avx-1.c (__builtin_ia32_getexpsd_mask_round, __builtin_ia32_getexpss_mask_round, __builtin_ia32_getmantsd_mask_round, __builtin_ia32_getmantss_mask_round): Test new builtins. * gcc.target/i386/sse-13.c : Ditto. * gcc.target/i386/sse-23.c: Ditto. * gcc.target/i386/sse-14.c (_mm_maskz_getexp_round_sd, _mm_maskz_getexp_round_ss, _mm_mask_getmant_round_sd, _mm_maskz_getmant_round_sd, _mm_mask_getmant_round_ss, _mm_maskz_getmant_round_ss, _mm_mask_getexp_round_sd, _mm_mask_getexp_round_ss): Test new intrinsics. * gcc.target/i386/testround-1.c: Ditto. * gcc.target/i386/sse-22.c (_mm_maskz_getmant_round_sd, _mm_maskz_getmant_round_ss, _mm_mask_getmant_round_sd, _mm_mask_getmant_round_ss): Test new intrinsics * gcc.target/i386/testimm-10.c (_mm_mask_getmant_sd, _mm_maskz_getmant_sd, _mm_mask_getmant_ss, _mm_maskz_getmant_ss): Test new intrinsics. From-SVN: r250018 --- gcc/ChangeLog | 46 +++ gcc/config/i386/avx512fintrin.h | 297 +++++++++++++++++- gcc/config/i386/i386-builtin-types.def | 2 + gcc/config/i386/i386-builtin.def | 4 + gcc/config/i386/i386.c | 4 + gcc/config/i386/sse.md | 12 +- gcc/config/i386/subst.md | 4 + gcc/testsuite/ChangeLog | 44 +++ gcc/testsuite/gcc.target/i386/avx-1.c | 4 + .../gcc.target/i386/avx512f-vgetexpsd-1.c | 9 + .../gcc.target/i386/avx512f-vgetexpsd-2.c | 35 ++- .../gcc.target/i386/avx512f-vgetexpss-1.c | 9 + .../gcc.target/i386/avx512f-vgetexpss-2.c | 37 ++- .../gcc.target/i386/avx512f-vgetmantsd-1.c | 12 +- .../gcc.target/i386/avx512f-vgetmantsd-2.c | 47 ++- .../gcc.target/i386/avx512f-vgetmantss-1.c | 12 +- .../gcc.target/i386/avx512f-vgetmantss-2.c | 48 ++- gcc/testsuite/gcc.target/i386/sse-13.c | 4 + gcc/testsuite/gcc.target/i386/sse-14.c | 8 + gcc/testsuite/gcc.target/i386/sse-22.c | 4 + gcc/testsuite/gcc.target/i386/sse-23.c | 4 + gcc/testsuite/gcc.target/i386/testimm-10.c | 4 + gcc/testsuite/gcc.target/i386/testround-1.c | 12 + 23 files changed, 635 insertions(+), 27 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 11051e6b587..49efdcd26b9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,49 @@ +2017-07-06 Sebastian Peryt + + * config/i386/avx512fintrin.h (_mm_mask_getexp_round_ss, + _mm_maskz_getexp_round_ss, _mm_mask_getexp_round_sd, + _mm_maskz_getexp_round_sd, _mm_mask_getmant_round_sd, + _mm_maskz_getmant_round_sd, _mm_mask_getmant_round_ss, + _mm_maskz_getmant_round_ss, _mm_mask_getexp_ss, _mm_maskz_getexp_ss, + _mm_mask_getexp_sd, _mm_maskz_getexp_sd, _mm_mask_getmant_sd, + _mm_maskz_getmant_sd, _mm_mask_getmant_ss, + _mm_maskz_getmant_ss): New intrinsics. + (__builtin_ia32_getexpss128_mask): Changed to ... + __builtin_ia32_getexpss128_round ... this. + (__builtin_ia32_getexpsd128_mask): Changed to ... + __builtin_ia32_getexpsd128_round ... this. + * config/i386/i386-builtin-types.def + ((V2DF, V2DF, V2DF, INT, V2DF, UQI, INT), + (V4SF, V4SF, V4SF, INT, V4SF, UQI, INT)): New function type aliases. + * config/i386/i386-builtin.def (__builtin_ia32_getexpsd_mask_round, + __builtin_ia32_getexpss_mask_round, __builtin_ia32_getmantsd_mask_round, + __builtin_ia32_getmantss_mask_round): New builtins. + * config/i386/i386.c (V2DF_FTYPE_V2DF_V2DF_INT_V2DF_UQI_INT, + V4SF_FTYPE_V4SF_V4SF_INT_V4SF_UQI_INT): Handle new types. + (CODE_FOR_avx512f_vgetmantv2df_mask_round, + CODE_FOR_avx512f_vgetmantv4sf_mask_round): New cases. + * config/i386/sse.md + (avx512f_sgetexp): Changed to ... + avx512f_sgetexp + ... this. + (vgetexp\t{%2, %1, %0| + %0, %1, %2}): Changed to ... + vgetexp + \t{%2, %1, %0| + %0, %1, %2} ... this. + (avx512f_vgetmant): Changed to ... + avx512f_vgetmant + ... this. + (vgetmant\t{%3, %2, %1, %0| + %0, %1, %2, %3}): Changed to ... + vgetmant + \t{%3, %2, %1, %0| + %0, %1, %2 + , %3} ... this. + * config/i386/subst.md (mask_scalar_operand4, + round_saeonly_scalar_mask_operand4, round_saeonly_scalar_mask_op4, + round_saeonly_scalar_nimm_predicate): New subst attributes. + 2017-07-06 Julia Koval * gcc/config/i386/i386.c (ix86_erase_embedded_rounding): diff --git a/gcc/config/i386/avx512fintrin.h b/gcc/config/i386/avx512fintrin.h index e383983afc1..72f57f7b6c9 100644 --- a/gcc/config/i386/avx512fintrin.h +++ b/gcc/config/i386/avx512fintrin.h @@ -8417,6 +8417,29 @@ _mm_getexp_round_ss (__m128 __A, __m128 __B, const int __R) __R); } +extern __inline __m128 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mask_getexp_round_ss (__m128 __W, __mmask8 __U, __m128 __A, + __m128 __B, const int __R) +{ + return (__m128) __builtin_ia32_getexpss_mask_round ((__v4sf) __A, + (__v4sf) __B, + (__v4sf) __W, + (__mmask8) __U, __R); +} + +extern __inline __m128 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskz_getexp_round_ss (__mmask8 __U, __m128 __A, __m128 __B, + const int __R) +{ + return (__m128) __builtin_ia32_getexpss_mask_round ((__v4sf) __A, + (__v4sf) __B, + (__v4sf) + _mm_setzero_ps (), + (__mmask8) __U, __R); +} + extern __inline __m128d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_getexp_round_sd (__m128d __A, __m128d __B, const int __R) @@ -8426,6 +8449,29 @@ _mm_getexp_round_sd (__m128d __A, __m128d __B, const int __R) __R); } +extern __inline __m128d +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mask_getexp_round_sd (__m128d __W, __mmask8 __U, __m128d __A, + __m128d __B, const int __R) +{ + return (__m128d) __builtin_ia32_getexpsd_mask_round ((__v2df) __A, + (__v2df) __B, + (__v2df) __W, + (__mmask8) __U, __R); +} + +extern __inline __m128d +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskz_getexp_round_sd (__mmask8 __U, __m128d __A, __m128d __B, + const int __R) +{ + return (__m128d) __builtin_ia32_getexpsd_mask_round ((__v2df) __A, + (__v2df) __B, + (__v2df) + _mm_setzero_pd (), + (__mmask8) __U, __R); +} + extern __inline __m512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_getexp_round_ps (__m512 __A, const int __R) @@ -8570,6 +8616,33 @@ _mm_getmant_round_sd (__m128d __A, __m128d __B, __R); } +extern __inline __m128d +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mask_getmant_round_sd (__m128d __W, __mmask8 __U, __m128d __A, + __m128d __B, _MM_MANTISSA_NORM_ENUM __C, + _MM_MANTISSA_SIGN_ENUM __D, const int __R) +{ + return (__m128d) __builtin_ia32_getmantsd_mask_round ((__v2df) __A, + (__v2df) __B, + (__D << 2) | __C, + (__v2df) __W, + __U, __R); +} + +extern __inline __m128d +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskz_getmant_round_sd (__mmask8 __U, __m128d __A, __m128d __B, + _MM_MANTISSA_NORM_ENUM __C, + _MM_MANTISSA_SIGN_ENUM __D, const int __R) +{ + return (__m128d) __builtin_ia32_getmantsd_mask_round ((__v2df) __A, + (__v2df) __B, + (__D << 2) | __C, + (__v2df) + _mm_setzero_pd(), + __U, __R); +} + extern __inline __m128 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_getmant_round_ss (__m128 __A, __m128 __B, @@ -8582,6 +8655,33 @@ _mm_getmant_round_ss (__m128 __A, __m128 __B, __R); } +extern __inline __m128 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mask_getmant_round_ss (__m128 __W, __mmask8 __U, __m128 __A, + __m128 __B, _MM_MANTISSA_NORM_ENUM __C, + _MM_MANTISSA_SIGN_ENUM __D, const int __R) +{ + return (__m128) __builtin_ia32_getmantss_mask_round ((__v4sf) __A, + (__v4sf) __B, + (__D << 2) | __C, + (__v4sf) __W, + __U, __R); +} + +extern __inline __m128 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskz_getmant_round_ss (__mmask8 __U, __m128 __A, __m128 __B, + _MM_MANTISSA_NORM_ENUM __C, + _MM_MANTISSA_SIGN_ENUM __D, const int __R) +{ + return (__m128) __builtin_ia32_getmantss_mask_round ((__v4sf) __A, + (__v4sf) __B, + (__D << 2) | __C, + (__v4sf) + _mm_setzero_ps(), + __U, __R); +} + #else #define _mm512_getmant_round_pd(X, B, C, R) \ ((__m512d)__builtin_ia32_getmantpd512_mask ((__v8df)(__m512d)(X), \ @@ -8629,18 +8729,63 @@ _mm_getmant_round_ss (__m128 __A, __m128 __B, (int)(((D)<<2) | (C)), \ (R))) +#define _mm_mask_getmant_round_sd(W, U, X, Y, C, D, R) \ + ((__m128d)__builtin_ia32_getmantsd_mask_round ((__v2df)(__m128d)(X), \ + (__v2df)(__m128d)(Y), \ + (int)(((D)<<2) | (C)), \ + (__v2df)(__m128d)(W), \ + (__mmask8)(U),\ + (R))) + +#define _mm_maskz_getmant_round_sd(U, X, Y, C, D, R) \ + ((__m128d)__builtin_ia32_getmantsd_mask_round ((__v2df)(__m128d)(X), \ + (__v2df)(__m128d)(Y), \ + (int)(((D)<<2) | (C)), \ + (__v2df)(__m128d)_mm_setzero_pd(), \ + (__mmask8)(U),\ + (R))) + #define _mm_getmant_round_ss(X, Y, C, D, R) \ ((__m128)__builtin_ia32_getmantss_round ((__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), \ (int)(((D)<<2) | (C)), \ (R))) +#define _mm_mask_getmant_round_ss(W, U, X, Y, C, D, R) \ + ((__m128)__builtin_ia32_getmantss_mask_round ((__v4sf)(__m128)(X), \ + (__v4sf)(__m128)(Y), \ + (int)(((D)<<2) | (C)), \ + (__v4sf)(__m128)(W), \ + (__mmask8)(U),\ + (R))) + +#define _mm_maskz_getmant_round_ss(U, X, Y, C, D, R) \ + ((__m128)__builtin_ia32_getmantss_mask_round ((__v4sf)(__m128)(X), \ + (__v4sf)(__m128)(Y), \ + (int)(((D)<<2) | (C)), \ + (__v4sf)(__m128)_mm_setzero_ps(), \ + (__mmask8)(U),\ + (R))) + #define _mm_getexp_round_ss(A, B, R) \ ((__m128)__builtin_ia32_getexpss128_round((__v4sf)(__m128)(A), (__v4sf)(__m128)(B), R)) +#define _mm_mask_getexp_round_ss(W, U, A, B, C) \ + (__m128)__builtin_ia32_getexpss_mask_round(A, B, W, U, C) + +#define _mm_maskz_getexp_round_ss(U, A, B, C) \ + (__m128)__builtin_ia32_getexpss_mask_round(A, B, (__v4sf)_mm_setzero_ps(), U, C) + #define _mm_getexp_round_sd(A, B, R) \ ((__m128d)__builtin_ia32_getexpsd128_round((__v2df)(__m128d)(A), (__v2df)(__m128d)(B), R)) +#define _mm_mask_getexp_round_sd(W, U, A, B, C) \ + (__m128d)__builtin_ia32_getexpsd_mask_round(A, B, W, U, C) + +#define _mm_maskz_getexp_round_sd(U, A, B, C) \ + (__m128d)__builtin_ia32_getexpsd_mask_round(A, B, (__v2df)_mm_setzero_pd(), U, C) + + #define _mm512_getexp_round_ps(A, R) \ ((__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \ (__v16sf)_mm512_undefined_ps(), (__mmask16)-1, R)) @@ -13358,6 +13503,29 @@ _mm_getexp_ss (__m128 __A, __m128 __B) _MM_FROUND_CUR_DIRECTION); } +extern __inline __m128 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mask_getexp_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_getexpss_mask_round ((__v4sf) __A, + (__v4sf) __B, + (__v4sf) __W, + (__mmask8) __U, + _MM_FROUND_CUR_DIRECTION); +} + +extern __inline __m128 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskz_getexp_ss (__mmask8 __U, __m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_getexpss_mask_round ((__v4sf) __A, + (__v4sf) __B, + (__v4sf) + _mm_setzero_ps (), + (__mmask8) __U, + _MM_FROUND_CUR_DIRECTION); +} + extern __inline __m128d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_getexp_sd (__m128d __A, __m128d __B) @@ -13367,6 +13535,29 @@ _mm_getexp_sd (__m128d __A, __m128d __B) _MM_FROUND_CUR_DIRECTION); } +extern __inline __m128d +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mask_getexp_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) +{ + return (__m128d) __builtin_ia32_getexpsd_mask_round ((__v2df) __A, + (__v2df) __B, + (__v2df) __W, + (__mmask8) __U, + _MM_FROUND_CUR_DIRECTION); +} + +extern __inline __m128d +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskz_getexp_sd (__mmask8 __U, __m128d __A, __m128d __B) +{ + return (__m128d) __builtin_ia32_getexpsd_mask_round ((__v2df) __A, + (__v2df) __B, + (__v2df) + _mm_setzero_pd (), + (__mmask8) __U, + _MM_FROUND_CUR_DIRECTION); +} + extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_getmant_pd (__m512d __A, _MM_MANTISSA_NORM_ENUM __B, @@ -13450,6 +13641,33 @@ _mm_getmant_sd (__m128d __A, __m128d __B, _MM_MANTISSA_NORM_ENUM __C, _MM_FROUND_CUR_DIRECTION); } +extern __inline __m128d +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mask_getmant_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B, + _MM_MANTISSA_NORM_ENUM __C, _MM_MANTISSA_SIGN_ENUM __D) +{ + return (__m128d) __builtin_ia32_getmantsd_mask_round ((__v2df) __A, + (__v2df) __B, + (__D << 2) | __C, + (__v2df) __W, + __U, + _MM_FROUND_CUR_DIRECTION); +} + +extern __inline __m128d +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskz_getmant_sd (__mmask8 __U, __m128d __A, __m128d __B, + _MM_MANTISSA_NORM_ENUM __C, _MM_MANTISSA_SIGN_ENUM __D) +{ + return (__m128d) __builtin_ia32_getmantsd_mask_round ((__v2df) __A, + (__v2df) __B, + (__D << 2) | __C, + (__v2df) + _mm_setzero_pd(), + __U, + _MM_FROUND_CUR_DIRECTION); +} + extern __inline __m128 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_getmant_ss (__m128 __A, __m128 __B, _MM_MANTISSA_NORM_ENUM __C, @@ -13461,6 +13679,33 @@ _mm_getmant_ss (__m128 __A, __m128 __B, _MM_MANTISSA_NORM_ENUM __C, _MM_FROUND_CUR_DIRECTION); } +extern __inline __m128 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mask_getmant_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B, + _MM_MANTISSA_NORM_ENUM __C, _MM_MANTISSA_SIGN_ENUM __D) +{ + return (__m128) __builtin_ia32_getmantss_mask_round ((__v4sf) __A, + (__v4sf) __B, + (__D << 2) | __C, + (__v4sf) __W, + __U, + _MM_FROUND_CUR_DIRECTION); +} + +extern __inline __m128 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskz_getmant_ss (__mmask8 __U, __m128 __A, __m128 __B, + _MM_MANTISSA_NORM_ENUM __C, _MM_MANTISSA_SIGN_ENUM __D) +{ + return (__m128) __builtin_ia32_getmantss_mask_round ((__v4sf) __A, + (__v4sf) __B, + (__D << 2) | __C, + (__v4sf) + _mm_setzero_ps(), + __U, + _MM_FROUND_CUR_DIRECTION); +} + #else #define _mm512_getmant_pd(X, B, C) \ ((__m512d)__builtin_ia32_getmantpd512_mask ((__v8df)(__m512d)(X), \ @@ -13508,20 +13753,68 @@ _mm_getmant_ss (__m128 __A, __m128 __B, _MM_MANTISSA_NORM_ENUM __C, (int)(((D)<<2) | (C)), \ _MM_FROUND_CUR_DIRECTION)) +#define _mm_mask_getmant_sd(W, U, X, Y, C, D) \ + ((__m128d)__builtin_ia32_getmantsd_mask_round ((__v2df)(__m128d)(X), \ + (__v2df)(__m128d)(Y), \ + (int)(((D)<<2) | (C)), \ + (__v2df)(__m128d)(W), \ + (__mmask8)(U),\ + _MM_FROUND_CUR_DIRECTION)) + +#define _mm_maskz_getmant_sd(U, X, Y, C, D) \ + ((__m128d)__builtin_ia32_getmantsd_mask_round ((__v2df)(__m128d)(X), \ + (__v2df)(__m128d)(Y), \ + (int)(((D)<<2) | (C)), \ + (__v2df)_mm_setzero_pd(), \ + (__mmask8)(U),\ + _MM_FROUND_CUR_DIRECTION)) + #define _mm_getmant_ss(X, Y, C, D) \ ((__m128)__builtin_ia32_getmantss_round ((__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), \ (int)(((D)<<2) | (C)), \ _MM_FROUND_CUR_DIRECTION)) +#define _mm_mask_getmant_ss(W, U, X, Y, C, D) \ + ((__m128)__builtin_ia32_getmantss_mask_round ((__v4sf)(__m128)(X), \ + (__v4sf)(__m128)(Y), \ + (int)(((D)<<2) | (C)), \ + (__v4sf)(__m128)(W), \ + (__mmask8)(U),\ + _MM_FROUND_CUR_DIRECTION)) + +#define _mm_maskz_getmant_ss(U, X, Y, C, D) \ + ((__m128)__builtin_ia32_getmantss_mask_round ((__v4sf)(__m128)(X), \ + (__v4sf)(__m128)(Y), \ + (int)(((D)<<2) | (C)), \ + (__v4sf)_mm_setzero_ps(), \ + (__mmask8)(U),\ + _MM_FROUND_CUR_DIRECTION)) + #define _mm_getexp_ss(A, B) \ - ((__m128)__builtin_ia32_getexpss128_mask((__v4sf)(__m128)(A), (__v4sf)(__m128)(B), \ + ((__m128)__builtin_ia32_getexpss128_round((__v4sf)(__m128)(A), (__v4sf)(__m128)(B), \ _MM_FROUND_CUR_DIRECTION)) +#define _mm_mask_getexp_ss(W, U, A, B) \ + (__m128)__builtin_ia32_getexpss_mask_round(A, B, W, U,\ + _MM_FROUND_CUR_DIRECTION) + +#define _mm_maskz_getexp_ss(U, A, B) \ + (__m128)__builtin_ia32_getexpss_mask_round(A, B, (__v4sf)_mm_setzero_ps(), U,\ + _MM_FROUND_CUR_DIRECTION) + #define _mm_getexp_sd(A, B) \ - ((__m128d)__builtin_ia32_getexpsd128_mask((__v2df)(__m128d)(A), (__v2df)(__m128d)(B),\ + ((__m128d)__builtin_ia32_getexpsd128_round((__v2df)(__m128d)(A), (__v2df)(__m128d)(B),\ _MM_FROUND_CUR_DIRECTION)) +#define _mm_mask_getexp_sd(W, U, A, B) \ + (__m128d)__builtin_ia32_getexpsd_mask_round(A, B, W, U,\ + _MM_FROUND_CUR_DIRECTION) + +#define _mm_maskz_getexp_sd(U, A, B) \ + (__m128d)__builtin_ia32_getexpsd_mask_round(A, B, (__v2df)_mm_setzero_pd(), U,\ + _MM_FROUND_CUR_DIRECTION) + #define _mm512_getexp_ps(A) \ ((__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \ (__v16sf)_mm512_undefined_ps(), (__mmask16)-1, _MM_FROUND_CUR_DIRECTION)) diff --git a/gcc/config/i386/i386-builtin-types.def b/gcc/config/i386/i386-builtin-types.def index 19d876d73f2..8d584dbe940 100644 --- a/gcc/config/i386/i386-builtin-types.def +++ b/gcc/config/i386/i386-builtin-types.def @@ -454,6 +454,8 @@ DEF_FUNCTION_TYPE (V8SF, V8SF, V8SF, V8SI, INT, UQI) DEF_FUNCTION_TYPE (V4SF, V4SF, V4SF, V4SI, INT, UQI) DEF_FUNCTION_TYPE (V4SF, V4SF, V4SF, V4SI, INT, QI, INT) DEF_FUNCTION_TYPE (V2DF, V2DF, V2DF, V2DI, INT, QI, INT) +DEF_FUNCTION_TYPE (V2DF, V2DF, V2DF, INT, V2DF, UQI, INT) +DEF_FUNCTION_TYPE (V4SF, V4SF, V4SF, INT, V4SF, UQI, INT) DEF_FUNCTION_TYPE (V16SF, V16SF, V4SF, INT) DEF_FUNCTION_TYPE (V16SF, V16SF, V4SF, INT, V16SF, UHI) DEF_FUNCTION_TYPE (V16SF, V16SF, V8SF, INT, V16SF, UHI) diff --git a/gcc/config/i386/i386-builtin.def b/gcc/config/i386/i386-builtin.def index 23e88839048..e91468a1a2e 100644 --- a/gcc/config/i386/i386-builtin.def +++ b/gcc/config/i386/i386-builtin.def @@ -2449,11 +2449,15 @@ BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_sfixupimmv4sf_maskz_round, "__b BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_getexpv8df_mask_round, "__builtin_ia32_getexppd512_mask", IX86_BUILTIN_GETEXPPD512, UNKNOWN, (int) V8DF_FTYPE_V8DF_V8DF_QI_INT) BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_getexpv16sf_mask_round, "__builtin_ia32_getexpps512_mask", IX86_BUILTIN_GETEXPPS512, UNKNOWN, (int) V16SF_FTYPE_V16SF_V16SF_HI_INT) BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_sgetexpv2df_round, "__builtin_ia32_getexpsd128_round", IX86_BUILTIN_GETEXPSD128, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT) +BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_sgetexpv2df_mask_round, "__builtin_ia32_getexpsd_mask_round", IX86_BUILTIN_GETEXPSD_MASK_ROUND, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_V2DF_UQI_INT) BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_sgetexpv4sf_round, "__builtin_ia32_getexpss128_round", IX86_BUILTIN_GETEXPSS128, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_INT) +BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_sgetexpv4sf_mask_round, "__builtin_ia32_getexpss_mask_round", IX86_BUILTIN_GETEXPSS_MASK_ROUND, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_V4SF_UQI_INT) BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_getmantv8df_mask_round, "__builtin_ia32_getmantpd512_mask", IX86_BUILTIN_GETMANTPD512, UNKNOWN, (int) V8DF_FTYPE_V8DF_INT_V8DF_QI_INT) BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_getmantv16sf_mask_round, "__builtin_ia32_getmantps512_mask", IX86_BUILTIN_GETMANTPS512, UNKNOWN, (int) V16SF_FTYPE_V16SF_INT_V16SF_HI_INT) BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_vgetmantv2df_round, "__builtin_ia32_getmantsd_round", IX86_BUILTIN_GETMANTSD128, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT_INT) +BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_vgetmantv2df_mask_round, "__builtin_ia32_getmantsd_mask_round", IX86_BUILTIN_GETMANTSD_MASK_ROUND, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT_V2DF_UQI_INT) BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_vgetmantv4sf_round, "__builtin_ia32_getmantss_round", IX86_BUILTIN_GETMANTSS128, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_INT_INT) +BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_vgetmantv4sf_mask_round, "__builtin_ia32_getmantss_mask_round", IX86_BUILTIN_GETMANTSS_MASK_ROUND, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_INT_V4SF_UQI_INT) BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_smaxv8df3_mask_round, "__builtin_ia32_maxpd512_mask", IX86_BUILTIN_MAXPD512, UNKNOWN, (int) V8DF_FTYPE_V8DF_V8DF_V8DF_UQI_INT) BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_smaxv16sf3_mask_round, "__builtin_ia32_maxps512_mask", IX86_BUILTIN_MAXPS512, UNKNOWN, (int) V16SF_FTYPE_V16SF_V16SF_V16SF_HI_INT) BDESC (OPTION_MASK_ISA_AVX512F, CODE_FOR_sse2_vmsmaxv2df3_round, "__builtin_ia32_maxsd_round", IX86_BUILTIN_MAXSD_ROUND, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index e2e4548dd26..afd61bf6f8c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -36701,6 +36701,8 @@ ix86_expand_round_builtin (const struct builtin_description *d, case V8DF_FTYPE_V8DF_V8DF_INT_V8DF_QI_INT: case V4SF_FTYPE_V4SF_V4SF_INT_V4SF_QI_INT: case V2DF_FTYPE_V2DF_V2DF_INT_V2DF_QI_INT: + case V2DF_FTYPE_V2DF_V2DF_INT_V2DF_UQI_INT: + case V4SF_FTYPE_V4SF_V4SF_INT_V4SF_UQI_INT: nargs = 6; nargs_constant = 4; break; @@ -36738,7 +36740,9 @@ ix86_expand_round_builtin (const struct builtin_description *d, case CODE_FOR_avx512f_getmantv8df_mask_round: case CODE_FOR_avx512f_getmantv16sf_mask_round: case CODE_FOR_avx512f_vgetmantv2df_round: + case CODE_FOR_avx512f_vgetmantv2df_mask_round: case CODE_FOR_avx512f_vgetmantv4sf_round: + case CODE_FOR_avx512f_vgetmantv4sf_mask_round: error ("the immediate argument must be a 4-bit immediate"); return const0_rtx; case CODE_FOR_avx512f_cmpv8df3_mask_round: diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index e557b35cd1e..e2db3b17f05 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -8294,17 +8294,17 @@ [(set_attr "prefix" "evex") (set_attr "mode" "")]) -(define_insn "avx512f_sgetexp" +(define_insn "avx512f_sgetexp" [(set (match_operand:VF_128 0 "register_operand" "=v") (vec_merge:VF_128 (unspec:VF_128 [(match_operand:VF_128 1 "register_operand" "v") - (match_operand:VF_128 2 "" "")] + (match_operand:VF_128 2 "" "")] UNSPEC_GETEXP) (match_dup 1) (const_int 1)))] "TARGET_AVX512F" - "vgetexp\t{%2, %1, %0|%0, %1, %2}"; + "vgetexp\t{%2, %1, %0|%0, %1, %2}"; [(set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -19501,18 +19501,18 @@ [(set_attr "prefix" "evex") (set_attr "mode" "")]) -(define_insn "avx512f_vgetmant" +(define_insn "avx512f_vgetmant" [(set (match_operand:VF_128 0 "register_operand" "=v") (vec_merge:VF_128 (unspec:VF_128 [(match_operand:VF_128 1 "register_operand" "v") - (match_operand:VF_128 2 "" "") + (match_operand:VF_128 2 "" "") (match_operand:SI 3 "const_0_to_15_operand")] UNSPEC_GETMANT) (match_dup 1) (const_int 1)))] "TARGET_AVX512F" - "vgetmant\t{%3, %2, %1, %0|%0, %1, %2, %3}"; + "vgetmant\t{%3, %2, %1, %0|%0, %1, %2, %3}"; [(set_attr "prefix" "evex") (set_attr "mode" "")]) diff --git a/gcc/config/i386/subst.md b/gcc/config/i386/subst.md index 1c7306efd3e..a318a8d4c80 100644 --- a/gcc/config/i386/subst.md +++ b/gcc/config/i386/subst.md @@ -239,6 +239,7 @@ (define_subst_attr "mask_scalar_name" "mask_scalar" "" "_mask") (define_subst_attr "mask_scalar_operand3" "mask_scalar" "" "%{%4%}%N3") +(define_subst_attr "mask_scalar_operand4" "mask_scalar" "" "%{%5%}%N4") (define_subst "mask_scalar" [(set (match_operand:SUBST_V 0) @@ -280,9 +281,12 @@ (define_subst_attr "round_saeonly_scalar_name" "round_saeonly_scalar" "" "_round") (define_subst_attr "round_saeonly_scalar_mask_operand3" "mask_scalar" "%r3" "%r5") +(define_subst_attr "round_saeonly_scalar_mask_operand4" "mask_scalar" "%r4" "%r6") (define_subst_attr "round_saeonly_scalar_mask_op3" "round_saeonly_scalar" "" "") +(define_subst_attr "round_saeonly_scalar_mask_op4" "round_saeonly_scalar" "" "") (define_subst_attr "round_saeonly_scalar_constraint" "round_saeonly_scalar" "vm" "v") (define_subst_attr "round_saeonly_scalar_prefix" "round_saeonly_scalar" "vex" "evex") +(define_subst_attr "round_saeonly_scalar_nimm_predicate" "round_saeonly_scalar" "vector_operand" "register_operand") (define_subst "round_saeonly_scalar" [(set (match_operand:SUBST_V 0) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d629c2bd90d..f4f2c0f17ec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,47 @@ +2017-07-06 Sebastian Peryt + + * gcc.target/i386/avx512f-vgetexpsd-1.c (_mm_mask_getexp_sd, + _mm_maskz_getexp_sd, _mm_mask_getexp_round_sd, + _mm_maskz_getexp_round_sd): Test new intrinsics. + * gcc.target/i386/avx512f-vgetexpss-1.c (_mm_mask_getexp_ss, + _mm_maskz_getexp_ss, _mm_mask_getexp_round_ss, + _mm_maskz_getexp_round_ss): Ditto. + * gcc.target/i386/avx512f-vgetmantsd-1.c (_mm_mask_getmant_sd, + _mm_maskz_getmant_sd, _mm_mask_getmant_round_sd, + _mm_maskz_getmant_round_sd): Ditto. + * gcc.target/i386/avx512f-vgetmantss-1.c (_mm_mask_getmant_ss, + _mm_maskz_getmant_ss, _mm_mask_getmant_round_ss, + _mm_maskz_getmant_round_ss): Ditto. + * gcc.target/i386/avx512f-vgetexpsd-2.c (_mm_mask_getexp_sd, + _mm_maskz_getexp_sd, _mm_getexp_round_sd, _mm_mask_getexp_round_sd, + _mm_maskz_getexp_round_sd): New runtime tests. + * gcc.target/i386/avx512f-vgetexpss-2.c (_mm_mask_getexp_ss, + _mm_maskz_getexp_ss, _mm_getexp_round_ss, _mm_mask_getexp_round_ss, + _mm_maskz_getexp_round_ss): Ditto. + * gcc.target/i386/avx512f-vgetmantsd-2.c (_mm_mask_getmant_sd, + _mm_maskz_getmant_sd, _mm_getmant_round_sd, _mm_mask_getmant_round_sd, + _mm_maskz_getmant_round_sd): Ditto. + * gcc.target/i386/avx512f-vgetmantss-2.c (_mm_mask_getmant_ss, + _mm_maskz_getmant_ss, _mm_getmant_round_ss, _mm_mask_getmant_round_ss, + _mm_maskz_getmant_round_ss): Ditto. + * gcc.target/i386/avx-1.c (__builtin_ia32_getexpsd_mask_round, + __builtin_ia32_getexpss_mask_round, __builtin_ia32_getmantsd_mask_round, + __builtin_ia32_getmantss_mask_round): Test new builtins. + * gcc.target/i386/sse-13.c : Ditto. + * gcc.target/i386/sse-23.c: Ditto. + * gcc.target/i386/sse-14.c (_mm_maskz_getexp_round_sd, + _mm_maskz_getexp_round_ss, _mm_mask_getmant_round_sd, + _mm_maskz_getmant_round_sd, _mm_mask_getmant_round_ss, + _mm_maskz_getmant_round_ss, _mm_mask_getexp_round_sd, + _mm_mask_getexp_round_ss): Test new intrinsics. + * gcc.target/i386/testround-1.c: Ditto. + * gcc.target/i386/sse-22.c (_mm_maskz_getmant_round_sd, + _mm_maskz_getmant_round_ss, _mm_mask_getmant_round_sd, + _mm_mask_getmant_round_ss): Test new intrinsics + * gcc.target/i386/testimm-10.c (_mm_mask_getmant_sd, + _mm_maskz_getmant_sd, _mm_mask_getmant_ss, + _mm_maskz_getmant_ss): Test new intrinsics. + 2017-07-06 Christophe Lyon * lib/target-supports-dg.exp (dg-require-stack-check): New. diff --git a/gcc/testsuite/gcc.target/i386/avx-1.c b/gcc/testsuite/gcc.target/i386/avx-1.c index 8377555f815..085ba81a672 100644 --- a/gcc/testsuite/gcc.target/i386/avx-1.c +++ b/gcc/testsuite/gcc.target/i386/avx-1.c @@ -233,11 +233,15 @@ #define __builtin_ia32_getexppd512_mask(A, B, C, D) __builtin_ia32_getexppd512_mask(A, B, C, 8) #define __builtin_ia32_getexpps512_mask(A, B, C, D) __builtin_ia32_getexpps512_mask(A, B, C, 8) #define __builtin_ia32_getexpsd128_round(A, B, C) __builtin_ia32_getexpsd128_round(A, B, 4) +#define __builtin_ia32_getexpsd_mask_round(A, B, C, D, E) __builtin_ia32_getexpsd_mask_round(A, B, C, D, 4) #define __builtin_ia32_getexpss128_round(A, B, C) __builtin_ia32_getexpss128_round(A, B, 4) +#define __builtin_ia32_getexpss_mask_round(A, B, C, D, E) __builtin_ia32_getexpss_mask_round(A, B, C, D, 4) #define __builtin_ia32_getmantpd512_mask(A, F, C, D, E) __builtin_ia32_getmantpd512_mask(A, 1, C, D, 8) #define __builtin_ia32_getmantps512_mask(A, F, C, D, E) __builtin_ia32_getmantps512_mask(A, 1, C, D, 8) #define __builtin_ia32_getmantsd_round(A, B, C, D) __builtin_ia32_getmantsd_round(A, B, 1, 4) +#define __builtin_ia32_getmantsd_mask_round(A, B, C, W, U, D) __builtin_ia32_getmantsd_mask_round(A, B, 1, W, U, 4) #define __builtin_ia32_getmantss_round(A, B, C, D) __builtin_ia32_getmantss_round(A, B, 1, 4) +#define __builtin_ia32_getmantss_mask_round(A, B, C, W, U, D) __builtin_ia32_getmantss_mask_round(A, B, 1, W, U, 4) #define __builtin_ia32_insertf32x4_mask(A, B, F, D, E) __builtin_ia32_insertf32x4_mask(A, B, 1, D, E) #define __builtin_ia32_insertf64x4_mask(A, B, F, D, E) __builtin_ia32_insertf64x4_mask(A, B, 1, D, E) #define __builtin_ia32_inserti32x4_mask(A, B, F, D, E) __builtin_ia32_inserti32x4_mask(A, B, 1, D, E) diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vgetexpsd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vgetexpsd-1.c index 63194a38b17..226cd9665ca 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vgetexpsd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vgetexpsd-1.c @@ -1,15 +1,24 @@ /* { dg-do compile } */ /* { dg-options "-mavx512f -O2" } */ /* { dg-final { scan-assembler-times "vgetexpsd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\, %xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetexpsd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetexpsd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vgetexpsd\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+\, %xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetexpsd\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetexpsd\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ #include volatile __m128d x; +volatile __mmask8 m; void extern avx512f_test (void) { x = _mm_getexp_sd (x, x); + x = _mm_mask_getexp_sd (x, m, x, x); + x = _mm_maskz_getexp_sd (m, x, x); x = _mm_getexp_round_sd (x, x, _MM_FROUND_NO_EXC); + x = _mm_mask_getexp_round_sd (x, m, x, x, _MM_FROUND_NO_EXC); + x = _mm_maskz_getexp_round_sd (m, x, x, _MM_FROUND_NO_EXC); } diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vgetexpsd-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vgetexpsd-2.c index 4f7c94db9ae..cb82448725f 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vgetexpsd-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vgetexpsd-2.c @@ -6,30 +6,61 @@ #include #include "avx512f-check.h" +#include "avx512f-helper.h" +#include "avx512f-mask-type.h" static void compute_vgetexpsd (double *s, double *r) { r[0] = floor (log (s[0]) / log (2)); + r[1] = s[1]; } void static avx512f_test (void) { int i; - union128d res1, s1; + union128d res1, res2, res3, res4, res5, res6, s1; + MASK_TYPE mask = MASK_VALUE; double res_ref[SIZE]; for (i = 0; i < SIZE; i++) { s1.a[i] = 5.0 - i; - res_ref[i] = s1.a[i]; + res2.a[i] = DEFAULT_VALUE; + res5.a[i] = DEFAULT_VALUE; } res1.x = _mm_getexp_sd (s1.x, s1.x); + res2.x = _mm_mask_getexp_sd (res2.x, mask, s1.x, s1.x); + res3.x = _mm_maskz_getexp_sd (mask, s1.x, s1.x); + res4.x = _mm_getexp_round_sd (s1.x, s1.x, _MM_FROUND_NO_EXC); + res5.x = _mm_mask_getexp_round_sd (res5.x, mask, s1.x, s1.x, _MM_FROUND_NO_EXC); + res6.x = _mm_maskz_getexp_round_sd (mask, s1.x, s1.x, _MM_FROUND_NO_EXC); compute_vgetexpsd (s1.a, res_ref); if (check_fp_union128d (res1, res_ref)) abort (); + + MASK_MERGE (d) (res_ref, mask, 1); + if (check_fp_union128d (res2, res_ref)) + abort (); + + MASK_ZERO (d) (res_ref, mask, 1); + if (check_fp_union128d (res3, res_ref)) + abort (); + + compute_vgetexpsd (s1.a, res_ref); + + if (check_fp_union128d (res4, res_ref)) + abort (); + + MASK_MERGE (d) (res_ref, mask, 1); + if (check_fp_union128d (res5, res_ref)) + abort (); + + MASK_ZERO (d) (res_ref, mask, 1); + if (check_fp_union128d (res6, res_ref)) + abort (); } diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vgetexpss-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vgetexpss-1.c index 9103e6ad84f..495b93c9c6a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vgetexpss-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vgetexpss-1.c @@ -1,15 +1,24 @@ /* { dg-do compile } */ /* { dg-options "-mavx512f -O2" } */ /* { dg-final { scan-assembler-times "vgetexpss\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\, %xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetexpss\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetexpss\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vgetexpss\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+\, %xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetexpss\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetexpss\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ #include volatile __m128 x; +volatile __mmask8 m; void extern avx512f_test (void) { x = _mm_getexp_ss (x, x); + x = _mm_mask_getexp_ss (x, m, x, x); + x = _mm_maskz_getexp_ss (m, x, x); x = _mm_getexp_round_ss (x, x, _MM_FROUND_NO_EXC); + x = _mm_mask_getexp_round_ss (x, m, x, x, _MM_FROUND_NO_EXC); + x = _mm_maskz_getexp_round_ss (m, x, x, _MM_FROUND_NO_EXC); } diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vgetexpss-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vgetexpss-2.c index 926f4d87ffb..ed193af78d4 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vgetexpss-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vgetexpss-2.c @@ -6,30 +6,63 @@ #include #include "avx512f-check.h" +#include "avx512f-helper.h" +#include "avx512f-mask-type.h" static void compute_vgetexpss (float *s, float *r) { + int i; r[0] = floor (log (s[0]) / log (2)); + for(i = 1; i < SIZE; i++) + r[i] = s[i]; } void static avx512f_test (void) { int i; - union128 res1, s1; + union128 res1, res2, res3, res4, res5, res6, s1; + MASK_TYPE mask = MASK_VALUE; float res_ref[SIZE]; for (i = 0; i < SIZE; i++) { s1.a[i] = 5.0 - i; - res_ref[i] = s1.a[i]; + res2.a[i] = DEFAULT_VALUE; + res5.a[i] = DEFAULT_VALUE; } res1.x = _mm_getexp_ss (s1.x, s1.x); + res2.x = _mm_mask_getexp_ss (res2.x, mask, s1.x, s1.x); + res3.x = _mm_maskz_getexp_ss (mask, s1.x, s1.x); + res4.x = _mm_getexp_round_ss (s1.x, s1.x, _MM_FROUND_NO_EXC); + res5.x = _mm_mask_getexp_round_ss (res5.x, mask, s1.x, s1.x, _MM_FROUND_NO_EXC); + res6.x = _mm_maskz_getexp_round_ss (mask, s1.x, s1.x, _MM_FROUND_NO_EXC); compute_vgetexpss (s1.a, res_ref); if (check_fp_union128 (res1, res_ref)) abort (); + + MASK_MERGE () (res_ref, mask, 1); + if (check_fp_union128 (res2, res_ref)) + abort (); + + MASK_ZERO () (res_ref, mask, 1); + if (check_fp_union128 (res3, res_ref)) + abort (); + + compute_vgetexpss (s1.a, res_ref); + + if (check_fp_union128 (res4, res_ref)) + abort (); + + MASK_MERGE () (res_ref, mask, 1); + if (check_fp_union128 (res5, res_ref)) + abort (); + + MASK_ZERO () (res_ref, mask, 1); + if (check_fp_union128 (res6, res_ref)) + abort (); } diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vgetmantsd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vgetmantsd-1.c index c501ba6729e..25a64202ea7 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vgetmantsd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vgetmantsd-1.c @@ -1,16 +1,24 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mavx512f" } */ /* { dg-final { scan-assembler-times "vgetmantsd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetmantsd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetmantsd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vgetmantsd\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetmantsd\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetmantsd\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ #include volatile __m128d x, y, z; +volatile __mmask8 m; void extern avx512f_test (void) { x = _mm_getmant_sd (y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src); - x = _mm_getmant_round_sd (y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src, - _MM_FROUND_NO_EXC); + x = _mm_mask_getmant_sd (x, m, y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src); + x = _mm_maskz_getmant_sd (m, y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src); + x = _mm_getmant_round_sd (y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src,_MM_FROUND_NO_EXC); + x = _mm_mask_getmant_round_sd (x, m, y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src, _MM_FROUND_NO_EXC); + x = _mm_maskz_getmant_round_sd (m, y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src, _MM_FROUND_NO_EXC); } diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vgetmantsd-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vgetmantsd-2.c index 3a34ca4f05d..45875b4a921 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vgetmantsd-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vgetmantsd-2.c @@ -5,6 +5,10 @@ #include "avx512f-check.h" #include +#include "avx512f-helper.h" + +#define SIZE (128/64) +#include "avx512f-mask-type.h" union fp_int_t { @@ -76,18 +80,51 @@ compute_vgetmantsd (double *r, double *s1, double *s2, int interv, static void avx512f_test (void) { - union128d res1, src1, src2; + union128d res1, res2, res3, res4, res5, res6, src1, src2; double res_ref[2]; - int interv = _MM_MANT_NORM_p5_1; - int signctrl = _MM_MANT_SIGN_src; + MASK_TYPE mask = MASK_VALUE; src1.x = _mm_set_pd (-3.0, 111.111); src2.x = _mm_set_pd (222.222, -2.0); + + int i; + for (i = 0; i < SIZE; i++) + { + res2.a[i] = DEFAULT_VALUE; + res5.a[i] = DEFAULT_VALUE; + } - res1.x = _mm_getmant_sd (src1.x, src2.x, interv, signctrl); + res1.x = _mm_getmant_sd (src1.x, src2.x, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src); + res2.x = _mm_mask_getmant_sd (res2.x, mask, src1.x, src2.x, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src); + res3.x = _mm_maskz_getmant_sd (mask, src1.x, src2.x, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src); + res4.x = _mm_getmant_round_sd (src1.x, src2.x, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src, _MM_FROUND_NO_EXC); + res5.x = _mm_mask_getmant_round_sd (res5.x, mask, src1.x, src2.x, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src, _MM_FROUND_NO_EXC); + res6.x = _mm_maskz_getmant_round_sd (mask, src1.x, src2.x, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src, _MM_FROUND_NO_EXC); - compute_vgetmantsd (res_ref, src1.a, src2.a, interv, signctrl); + compute_vgetmantsd (res_ref, src1.a, src2.a, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src); if (check_union128d (res1, res_ref)) abort (); + + MASK_MERGE (d) (res_ref, mask, 1); + if (check_union128d (res2, res_ref)) + abort (); + + MASK_ZERO (d) (res_ref, mask, 1); + if (check_union128d (res3, res_ref)) + abort (); + + compute_vgetmantsd (res_ref, src1.a, src2.a, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src); + + if (check_union128d (res4, res_ref)) + abort (); + + MASK_MERGE (d) (res_ref, mask, 1); + if (check_union128d (res5, res_ref)) + abort (); + + MASK_ZERO (d) (res_ref, mask, 1); + if (check_union128d (res6, res_ref)) + abort (); + } diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vgetmantss-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vgetmantss-1.c index 8ce9d467806..00a055ffeee 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vgetmantss-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vgetmantss-1.c @@ -1,16 +1,24 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mavx512f" } */ /* { dg-final { scan-assembler-times "vgetmantss\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetmantss\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetmantss\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vgetmantss\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetmantss\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vgetmantss\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ #include volatile __m128 x, y, z; +volatile __mmask8 m; void extern avx512f_test (void) { x = _mm_getmant_ss (y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src); - x = _mm_getmant_round_ss (y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src, - _MM_FROUND_NO_EXC); + x = _mm_mask_getmant_ss (x, m, y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src); + x = _mm_maskz_getmant_ss (m, y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src); + x = _mm_getmant_round_ss (y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src, _MM_FROUND_NO_EXC); + x = _mm_mask_getmant_round_ss (x, m, y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src, _MM_FROUND_NO_EXC); + x = _mm_maskz_getmant_round_ss (m, y, z, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_src, _MM_FROUND_NO_EXC); } diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vgetmantss-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vgetmantss-2.c index 7c30ea7d8e6..bcd449b4ae2 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vgetmantss-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vgetmantss-2.c @@ -5,6 +5,10 @@ #include "avx512f-check.h" #include +#include "avx512f-helper.h" + +#define SIZE (128/32) +#include "avx512f-mask-type.h" union fp_int_t { @@ -72,7 +76,7 @@ compute_vgetmantss (float *r, float *s1, float *s2, int interv, { int i; r[0] = get_norm_mant (s2[0], signctrl, interv); - for (i = 1; i < 4; i++) + for (i = 1; i < SIZE; i++) { r[i] = s1[i]; } @@ -81,18 +85,50 @@ compute_vgetmantss (float *r, float *s1, float *s2, int interv, static void avx512f_test (void) { - union128 res1, src1, src2; + union128 res1, res2, res3, res4, res5, res6, src1, src2; float res_ref[4]; - int interv = _MM_MANT_NORM_p5_1; - int signctrl = _MM_MANT_SIGN_src; + MASK_TYPE mask = MASK_VALUE; src1.x = _mm_set_ps (-24.043, 68.346, -43.35, 546.46); src2.x = _mm_set_ps (222.222, 333.333, 444.444, -2.0); - res1.x = _mm_getmant_ss (src1.x, src2.x, interv, signctrl); + int i; + for (i = 0; i < SIZE; i++) + { + res2.a[i] = DEFAULT_VALUE; + res5.a[i] = DEFAULT_VALUE; + } + + res1.x = _mm_getmant_ss (src1.x, src2.x, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src); + res2.x = _mm_mask_getmant_ss (res2.x, mask, src1.x, src2.x, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src); + res3.x = _mm_maskz_getmant_ss (mask, src1.x, src2.x, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src); + res4.x = _mm_getmant_round_ss (src1.x, src2.x, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src, _MM_FROUND_NO_EXC); + res5.x = _mm_mask_getmant_round_ss (res5.x, mask, src1.x, src2.x, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src, _MM_FROUND_NO_EXC); + res6.x = _mm_maskz_getmant_round_ss (mask, src1.x, src2.x, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src, _MM_FROUND_NO_EXC); - compute_vgetmantss (res_ref, src1.a, src2.a, interv, signctrl); + compute_vgetmantss (res_ref, src1.a, src2.a, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src); if (check_union128 (res1, res_ref)) abort (); + + MASK_MERGE () (res_ref, mask, 1); + if (check_union128 (res2, res_ref)) + abort (); + + MASK_ZERO () (res_ref, mask, 1); + if (check_union128 (res3, res_ref)) + abort (); + + compute_vgetmantss (res_ref, src1.a, src2.a, _MM_MANT_NORM_p5_1, _MM_MANT_SIGN_src); + + if (check_union128 (res4, res_ref)) + abort (); + + MASK_MERGE () (res_ref, mask, 1); + if (check_union128 (res5, res_ref)) + abort (); + + MASK_ZERO () (res_ref, mask, 1); + if (check_union128 (res6, res_ref)) + abort (); } diff --git a/gcc/testsuite/gcc.target/i386/sse-13.c b/gcc/testsuite/gcc.target/i386/sse-13.c index 79879d7cc16..c5c43b12611 100644 --- a/gcc/testsuite/gcc.target/i386/sse-13.c +++ b/gcc/testsuite/gcc.target/i386/sse-13.c @@ -250,11 +250,15 @@ #define __builtin_ia32_getexppd512_mask(A, B, C, D) __builtin_ia32_getexppd512_mask(A, B, C, 8) #define __builtin_ia32_getexpps512_mask(A, B, C, D) __builtin_ia32_getexpps512_mask(A, B, C, 8) #define __builtin_ia32_getexpsd128_round(A, B, C) __builtin_ia32_getexpsd128_round(A, B, 4) +#define __builtin_ia32_getexpsd_mask_round(A, B, C, D, E) __builtin_ia32_getexpsd_mask_round(A, B, C, D, 4) #define __builtin_ia32_getexpss128_round(A, B, C) __builtin_ia32_getexpss128_round(A, B, 4) +#define __builtin_ia32_getexpss_mask_round(A, B, C, D, E) __builtin_ia32_getexpss_mask_round(A, B, C, D, 4) #define __builtin_ia32_getmantpd512_mask(A, F, C, D, E) __builtin_ia32_getmantpd512_mask(A, 1, C, D, 8) #define __builtin_ia32_getmantps512_mask(A, F, C, D, E) __builtin_ia32_getmantps512_mask(A, 1, C, D, 8) #define __builtin_ia32_getmantsd_round(A, B, C, D) __builtin_ia32_getmantsd_round(A, B, 1, 4) +#define __builtin_ia32_getmantsd_mask_round(A, B, C, W, U, D) __builtin_ia32_getmantsd_mask_round(A, B, 1, W, U, 4) #define __builtin_ia32_getmantss_round(A, B, C, D) __builtin_ia32_getmantss_round(A, B, 1, 4) +#define __builtin_ia32_getmantss_mask_round(A, B, C, W, U, D) __builtin_ia32_getmantss_mask_round(A, B, 1, W, U, 4) #define __builtin_ia32_insertf32x4_mask(A, B, F, D, E) __builtin_ia32_insertf32x4_mask(A, B, 1, D, E) #define __builtin_ia32_insertf64x4_mask(A, B, F, D, E) __builtin_ia32_insertf64x4_mask(A, B, 1, D, E) #define __builtin_ia32_inserti32x4_mask(A, B, F, D, E) __builtin_ia32_inserti32x4_mask(A, B, 1, D, E) diff --git a/gcc/testsuite/gcc.target/i386/sse-14.c b/gcc/testsuite/gcc.target/i386/sse-14.c index 547314aef07..c2a19b3ccef 100644 --- a/gcc/testsuite/gcc.target/i386/sse-14.c +++ b/gcc/testsuite/gcc.target/i386/sse-14.c @@ -244,7 +244,9 @@ test_2 (_mm512_maskz_extractf64x4_pd, __m256d, __mmask8, __m512d, 1) test_2 (_mm512_maskz_extracti32x4_epi32, __m128i, __mmask8, __m512i, 1) test_2 (_mm512_maskz_extracti64x4_epi64, __m256i, __mmask8, __m512i, 1) test_2 (_mm512_maskz_getexp_round_pd, __m512d, __mmask8, __m512d, 8) +test_3 (_mm_maskz_getexp_round_sd, __m128d, __mmask8, __m128d, __m128d, 8) test_2 (_mm512_maskz_getexp_round_ps, __m512, __mmask16, __m512, 8) +test_3 (_mm_maskz_getexp_round_ss, __m128, __mmask8, __m128, __m128, 8) test_2y (_mm512_maskz_getmant_round_pd, __m512d, __mmask8, __m512d, 1, 1, 8) test_2y (_mm512_maskz_getmant_round_ps, __m512, __mmask16, __m512, 1, 1, 8) test_2 (_mm512_maskz_permute_pd, __m512d, __mmask8, __m512d, 1) @@ -300,7 +302,11 @@ test_2 (_mm_div_round_ss, __m128, __m128, __m128, 9) test_2 (_mm_getexp_round_sd, __m128d, __m128d, __m128d, 8) test_2 (_mm_getexp_round_ss, __m128, __m128, __m128, 8) test_2y (_mm_getmant_round_sd, __m128d, __m128d, __m128d, 1, 1, 8) +test_4y (_mm_mask_getmant_round_sd, __m128d, __m128d, __mmask8, __m128d, __m128d, 1, 1, 8) +test_3y (_mm_maskz_getmant_round_sd, __m128d, __mmask8, __m128d, __m128d, 1, 1, 8) test_2y (_mm_getmant_round_ss, __m128, __m128, __m128, 1, 1, 8) +test_4y (_mm_mask_getmant_round_ss, __m128, __m128, __mmask8, __m128, __m128, 1, 1, 8) +test_3y (_mm_maskz_getmant_round_ss, __m128, __mmask8, __m128, __m128, 1, 1, 8) test_2 (_mm_mul_round_sd, __m128d, __m128d, __m128d, 9) test_2 (_mm_mul_round_ss, __m128, __m128, __m128, 9) test_2 (_mm_scalef_round_sd, __m128d, __m128d, __m128d, 9) @@ -356,7 +362,9 @@ test_3 (_mm512_mask_extractf64x4_pd, __m256d, __m256d, __mmask8, __m512d, 1) test_3 (_mm512_mask_extracti32x4_epi32, __m128i, __m128i, __mmask8, __m512i, 1) test_3 (_mm512_mask_extracti64x4_epi64, __m256i, __m256i, __mmask8, __m512i, 1) test_3 (_mm512_mask_getexp_round_pd, __m512d, __m512d, __mmask8, __m512d, 8) +test_4 (_mm_mask_getexp_round_sd, __m128d, __m128d, __mmask8, __m128d, __m128d, 8) test_3 (_mm512_mask_getexp_round_ps, __m512, __m512, __mmask16, __m512, 8) +test_4 (_mm_mask_getexp_round_ss, __m128, __m128, __mmask8, __m128, __m128, 8) test_3y (_mm512_mask_getmant_round_pd, __m512d, __m512d, __mmask8, __m512d, 1, 1, 8) test_3y (_mm512_mask_getmant_round_ps, __m512, __m512, __mmask16, __m512, 1, 1, 8) test_3 (_mm512_mask_permute_pd, __m512d, __m512d, __mmask8, __m512d, 1) diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c index b8a35d11c45..cd8945be1cb 100644 --- a/gcc/testsuite/gcc.target/i386/sse-22.c +++ b/gcc/testsuite/gcc.target/i386/sse-22.c @@ -399,7 +399,9 @@ test_2 (_mm512_maskz_extracti64x4_epi64, __m256i, __mmask8, __m512i, 1) test_2 (_mm512_maskz_getexp_round_pd, __m512d, __mmask8, __m512d, 8) test_2 (_mm512_maskz_getexp_round_ps, __m512, __mmask16, __m512, 8) test_2y (_mm512_maskz_getmant_round_pd, __m512d, __mmask8, __m512d, 1, 1, 8) +test_3y (_mm_maskz_getmant_round_sd, __m128d, __mmask8, __m128d, __m128d, 1, 1, 8) test_2y (_mm512_maskz_getmant_round_ps, __m512, __mmask16, __m512, 1, 1, 8) +test_3y (_mm_maskz_getmant_round_ss, __m128, __mmask8, __m128, __m128, 1, 1, 8) test_2 (_mm512_maskz_permute_pd, __m512d, __mmask8, __m512d, 1) test_2 (_mm512_maskz_permute_ps, __m512, __mmask16, __m512, 1) test_2 (_mm512_maskz_permutex_epi64, __m512i, __mmask8, __m512i, 1) @@ -491,7 +493,9 @@ test_3 (_mm512_mask_extracti64x4_epi64, __m256i, __m256i, __mmask8, __m512i, 1) test_3 (_mm512_mask_getexp_round_pd, __m512d, __m512d, __mmask8, __m512d, 8) test_3 (_mm512_mask_getexp_round_ps, __m512, __m512, __mmask16, __m512, 8) test_3y (_mm512_mask_getmant_round_pd, __m512d, __m512d, __mmask8, __m512d, 1, 1, 8) +test_4y (_mm_mask_getmant_round_sd, __m128d, __m128d, __mmask8, __m128d, __m128d, 1, 1, 8) test_3y (_mm512_mask_getmant_round_ps, __m512, __m512, __mmask16, __m512, 1, 1, 8) +test_4y (_mm_mask_getmant_round_ss, __m128, __m128, __mmask8, __m128, __m128, 1, 1, 8) test_3 (_mm512_mask_permute_pd, __m512d, __m512d, __mmask8, __m512d, 1) test_3 (_mm512_mask_permute_ps, __m512, __m512, __mmask16, __m512, 1) test_3 (_mm512_mask_permutex_epi64, __m512i, __m512i, __mmask8, __m512i, 1) diff --git a/gcc/testsuite/gcc.target/i386/sse-23.c b/gcc/testsuite/gcc.target/i386/sse-23.c index 96c663b64d3..fc339a51e63 100644 --- a/gcc/testsuite/gcc.target/i386/sse-23.c +++ b/gcc/testsuite/gcc.target/i386/sse-23.c @@ -251,11 +251,15 @@ #define __builtin_ia32_getexppd512_mask(A, B, C, D) __builtin_ia32_getexppd512_mask(A, B, C, 8) #define __builtin_ia32_getexpps512_mask(A, B, C, D) __builtin_ia32_getexpps512_mask(A, B, C, 8) #define __builtin_ia32_getexpsd128_round(A, B, C) __builtin_ia32_getexpsd128_round(A, B, 4) +#define __builtin_ia32_getexpsd_mask_round(A, B, C, D, E) __builtin_ia32_getexpsd_mask_round(A, B, C, D, 4) #define __builtin_ia32_getexpss128_round(A, B, C) __builtin_ia32_getexpss128_round(A, B, 4) +#define __builtin_ia32_getexpss_mask_round(A, B, C, D, E) __builtin_ia32_getexpss_mask_round(A, B, C, D, 4) #define __builtin_ia32_getmantpd512_mask(A, F, C, D, E) __builtin_ia32_getmantpd512_mask(A, 1, C, D, 8) #define __builtin_ia32_getmantps512_mask(A, F, C, D, E) __builtin_ia32_getmantps512_mask(A, 1, C, D, 8) #define __builtin_ia32_getmantsd_round(A, B, C, D) __builtin_ia32_getmantsd_round(A, B, 1, 4) +#define __builtin_ia32_getmantsd_mask_round(A, B, C, W, U, D) __builtin_ia32_getmantsd_mask_round(A, B, 1, W, U, 4) #define __builtin_ia32_getmantss_round(A, B, C, D) __builtin_ia32_getmantss_round(A, B, 1, 4) +#define __builtin_ia32_getmantss_mask_round(A, B, C, W, U, D) __builtin_ia32_getmantss_mask_round(A, B, 1, W, U, 4) #define __builtin_ia32_insertf32x4_mask(A, B, F, D, E) __builtin_ia32_insertf32x4_mask(A, B, 1, D, E) #define __builtin_ia32_insertf64x4_mask(A, B, F, D, E) __builtin_ia32_insertf64x4_mask(A, B, 1, D, E) #define __builtin_ia32_inserti32x4_mask(A, B, F, D, E) __builtin_ia32_inserti32x4_mask(A, B, 1, D, E) diff --git a/gcc/testsuite/gcc.target/i386/testimm-10.c b/gcc/testsuite/gcc.target/i386/testimm-10.c index c2bf0dbabd1..d0e9b42f2fe 100644 --- a/gcc/testsuite/gcc.target/i386/testimm-10.c +++ b/gcc/testsuite/gcc.target/i386/testimm-10.c @@ -191,5 +191,9 @@ test4bit (void) { m512 = _mm512_maskz_getmant_ps (mmask16, m512, 1, 64); /* { dg-error "the immediate argument must be a 4-bit immediate" } */ m128d = _mm_getmant_sd (m128d, m128d, 1, 64); /* { dg-error "the immediate argument must be a 4-bit immediate" } */ + m128d = _mm_mask_getmant_sd (m128d, mmask8, m128d, m128d, 1, 64); /* { dg-error "the immediate argument must be a 4-bit immediate" } */ + m128d = _mm_maskz_getmant_sd (mmask8, m128d, m128d, 1, 64); /* { dg-error "the immediate argument must be a 4-bit immediate" } */ m128 = _mm_getmant_ss (m128, m128, 1, 64); /* { dg-error "the immediate argument must be a 4-bit immediate" } */ + m128 = _mm_mask_getmant_ss (m128, mmask8, m128, m128, 1, 64); /* { dg-error "the immediate argument must be a 4-bit immediate" } */ + m128 = _mm_maskz_getmant_ss (mmask8, m128, m128, 1, 64); /* { dg-error "the immediate argument must be a 4-bit immediate" } */ } diff --git a/gcc/testsuite/gcc.target/i386/testround-1.c b/gcc/testsuite/gcc.target/i386/testround-1.c index 2c1338164f5..d5ab95c208e 100644 --- a/gcc/testsuite/gcc.target/i386/testround-1.c +++ b/gcc/testsuite/gcc.target/i386/testround-1.c @@ -249,7 +249,11 @@ test_round (void) m128d = _mm_cvt_roundss_sd (m128d, m128, 7); /* { dg-error "incorrect rounding operand" } */ m128 = _mm_getexp_round_ss (m128, m128, 7); /* { dg-error "incorrect rounding operand" } */ + m128 = _mm_mask_getexp_round_ss (m128, mmask8, m128, m128, 7); /* { dg-error "incorrect rounding operand" } */ + m128 = _mm_maskz_getexp_round_ss (mmask8, m128, m128, 7); /* { dg-error "incorrect rounding operand" } */ m128d = _mm_getexp_round_sd (m128d, m128d, 7); /* { dg-error "incorrect rounding operand" } */ + m128d = _mm_mask_getexp_round_sd (m128d, mmask8, m128d, m128d, 7); /* { dg-error "incorrect rounding operand" } */ + m128d = _mm_maskz_getexp_round_sd (mmask8, m128d, m128d, 7); /* { dg-error "incorrect rounding operand" } */ m512 = _mm512_getexp_round_ps (m512, 7); /* { dg-error "incorrect rounding operand" } */ m512 = _mm512_mask_getexp_round_ps (m512, mmask16, m512, 7); /* { dg-error "incorrect rounding operand" } */ m512 = _mm512_maskz_getexp_round_ps (mmask16, m512, 7); /* { dg-error "incorrect rounding operand" } */ @@ -263,7 +267,11 @@ test_round (void) m512 = _mm512_mask_getmant_round_ps (m512, mmask16, m512, 0, 0, 7); /* { dg-error "incorrect rounding operand" } */ m512 = _mm512_maskz_getmant_round_ps (mmask16, m512, 0, 0, 7); /* { dg-error "incorrect rounding operand" } */ m128d = _mm_getmant_round_sd (m128d, m128d, 0, 0, 7); /* { dg-error "incorrect rounding operand" } */ + m128d = _mm_mask_getmant_round_sd (m128d, mmask8, m128d, m128d, 0, 0, 7); /* { dg-error "incorrect rounding operand" } */ + m128d = _mm_maskz_getmant_round_sd (mmask8, m128d, m128d, 0, 0, 7); /* { dg-error "incorrect rounding operand" } */ m128 = _mm_getmant_round_ss (m128, m128, 0, 0, 7); /* { dg-error "incorrect rounding operand" } */ + m128 = _mm_mask_getmant_round_ss (m128, mmask8, m128, m128, 0, 0, 7); /* { dg-error "incorrect rounding operand" } */ + m128 = _mm_maskz_getmant_round_ss (mmask8, m128, m128, 0, 0, 7); /* { dg-error "incorrect rounding operand" } */ m512 = _mm512_roundscale_round_ps (m512, 4, 7); /* { dg-error "incorrect rounding operand" } */ m512 = _mm512_mask_roundscale_round_ps (m512, mmask16, m512, 4, 7); /* { dg-error "incorrect rounding operand" } */ @@ -524,7 +532,11 @@ test_sae_only (void) m128d = _mm_cvt_roundss_sd (m128d, m128, 3); /* { dg-error "incorrect rounding operand" } */ m128 = _mm_getexp_round_ss (m128, m128, 3); /* { dg-error "incorrect rounding operand" } */ + m128 = _mm_mask_getexp_round_ss (m128, mmask8, m128, m128, 3); /* { dg-error "incorrect rounding operand" } */ + m128 = _mm_maskz_getexp_round_ss (mmask8, m128, m128, 3); /* { dg-error "incorrect rounding operand" } */ m128d = _mm_getexp_round_sd (m128d, m128d, 3); /* { dg-error "incorrect rounding operand" } */ + m128d = _mm_mask_getexp_round_sd (m128d, mmask8, m128d, m128d, 5); /* { dg-error "incorrect rounding operand" } */ + m128d = _mm_maskz_getexp_round_sd (mmask8, m128d, m128d, 5); /* { dg-error "incorrect rounding operand" } */ m512 = _mm512_getexp_round_ps (m512, 3); /* { dg-error "incorrect rounding operand" } */ m512 = _mm512_mask_getexp_round_ps (m512, mmask16, m512, 3); /* { dg-error "incorrect rounding operand" } */ m512 = _mm512_maskz_getexp_round_ps (mmask16, m512, 3); /* { dg-error "incorrect rounding operand" } */ -- 2.30.2