Add missing intrinsics for VGETMANT[SD,SS] and VGETEXP[SD,SS]
authorSebastian Peryt <sebastian.peryt@intel.com>
Thu, 6 Jul 2017 11:52:05 +0000 (13:52 +0200)
committerKirill Yukhin <kyukhin@gcc.gnu.org>
Thu, 6 Jul 2017 11:52:05 +0000 (11:52 +0000)
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<mode><round_saeonly_name>): Changed to ...
avx512f_sgetexp<mode><mask_scalar_name>
<round_saeonly_scalar_name> ... this.
(vgetexp<ssescalarmodesuffix>\t{<round_saeonly_op3>%2, %1, %0|
%0, %1, %2<round_saeonly_op3>}): Changed to ...
vgetexp<ssescalarmodesuffix>
\t{<round_saeonly_scalar_mask_op3>%2, %1, %0<mask_scalar_operand3>|
%0<mask_scalar_operand3>, %1, %2<round_saeonly_scalar_mask_op3>} ... this.
(avx512f_vgetmant<mode><round_saeonly_name>): Changed to ...
avx512f_vgetmant<mode><mask_scalar_name>
<round_saeonly_scalar_name> ... this.
(vgetmant<ssescalarmodesuffix>\t{%3, <round_saeonly_op4>%2, %1, %0|
%0, %1, %2<round_saeonly_op4>, %3}): Changed to ...
vgetmant<ssescalarmodesuffix>
\t{%3, <round_saeonly_scalar_mask_op4>%2, %1, %0<mask_scalar_operand4>|
%0<mask_scalar_operand4>, %1, %2
<round_saeonly_scalar_mask_op4>, %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

23 files changed:
gcc/ChangeLog
gcc/config/i386/avx512fintrin.h
gcc/config/i386/i386-builtin-types.def
gcc/config/i386/i386-builtin.def
gcc/config/i386/i386.c
gcc/config/i386/sse.md
gcc/config/i386/subst.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/avx-1.c
gcc/testsuite/gcc.target/i386/avx512f-vgetexpsd-1.c
gcc/testsuite/gcc.target/i386/avx512f-vgetexpsd-2.c
gcc/testsuite/gcc.target/i386/avx512f-vgetexpss-1.c
gcc/testsuite/gcc.target/i386/avx512f-vgetexpss-2.c
gcc/testsuite/gcc.target/i386/avx512f-vgetmantsd-1.c
gcc/testsuite/gcc.target/i386/avx512f-vgetmantsd-2.c
gcc/testsuite/gcc.target/i386/avx512f-vgetmantss-1.c
gcc/testsuite/gcc.target/i386/avx512f-vgetmantss-2.c
gcc/testsuite/gcc.target/i386/sse-13.c
gcc/testsuite/gcc.target/i386/sse-14.c
gcc/testsuite/gcc.target/i386/sse-22.c
gcc/testsuite/gcc.target/i386/sse-23.c
gcc/testsuite/gcc.target/i386/testimm-10.c
gcc/testsuite/gcc.target/i386/testround-1.c

index 11051e6b587df90c9e645fadae482d183387fbd0..49efdcd26b9424f150e2fa195360064f89b52694 100644 (file)
@@ -1,3 +1,49 @@
+2017-07-06  Sebastian Peryt  <sebastian.peryt@intel.com>
+
+       * 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<mode><round_saeonly_name>): Changed to ...
+       avx512f_sgetexp<mode><mask_scalar_name>
+       <round_saeonly_scalar_name> ... this.
+       (vgetexp<ssescalarmodesuffix>\t{<round_saeonly_op3>%2, %1, %0|
+       %0, %1, %2<round_saeonly_op3>}): Changed to ...
+       vgetexp<ssescalarmodesuffix>
+       \t{<round_saeonly_scalar_mask_op3>%2, %1, %0<mask_scalar_operand3>|
+       %0<mask_scalar_operand3>, %1, %2<round_saeonly_scalar_mask_op3>} ... this.
+       (avx512f_vgetmant<mode><round_saeonly_name>): Changed to ...
+       avx512f_vgetmant<mode><mask_scalar_name>
+       <round_saeonly_scalar_name> ... this.
+       (vgetmant<ssescalarmodesuffix>\t{%3, <round_saeonly_op4>%2, %1, %0|
+       %0, %1, %2<round_saeonly_op4>, %3}): Changed to ...
+       vgetmant<ssescalarmodesuffix>
+       \t{%3, <round_saeonly_scalar_mask_op4>%2, %1, %0<mask_scalar_operand4>|
+       %0<mask_scalar_operand4>, %1, %2
+       <round_saeonly_scalar_mask_op4>, %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  <julia.koval@intel.com>
 
        * gcc/config/i386/i386.c (ix86_erase_embedded_rounding):
index e383983afc1bf0dd3b12f15e627492b4955352c6..72f57f7b6c930a5582b5e3835a09603bd085b3d1 100644 (file)
@@ -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))
index 19d876d73f2739cc393febfbb94a2eccb8b2c30c..8d584dbe940fba5188aa81e2657c320b806ec746 100644 (file)
@@ -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)
index 23e88839048e6ce20879dfd62db372a98058e255..e91468a1a2ec2d49b1b0341d0a06d9dc6481b31f 100644 (file)
@@ -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)
index e2e4548dd2601c7e705121fec5ee98cc60a9bd9a..afd61bf6f8ce514c623110825e94940a09feeada 100644 (file)
@@ -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:
index e557b35cd1eb2f7a3d638c9370001700c92cb7bc..e2db3b17f05872389d82580b85f3e242eb206eac 100644 (file)
     [(set_attr "prefix" "evex")
      (set_attr "mode" "<MODE>")])
 
-(define_insn "avx512f_sgetexp<mode><round_saeonly_name>"
+(define_insn "avx512f_sgetexp<mode><mask_scalar_name><round_saeonly_scalar_name>"
   [(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 "<round_saeonly_nimm_predicate>" "<round_saeonly_constraint>")]
+            (match_operand:VF_128 2 "<round_saeonly_scalar_nimm_predicate>" "<round_saeonly_scalar_constraint>")]
            UNSPEC_GETEXP)
          (match_dup 1)
          (const_int 1)))]
    "TARGET_AVX512F"
-   "vgetexp<ssescalarmodesuffix>\t{<round_saeonly_op3>%2, %1, %0|%0, %1, %2<round_saeonly_op3>}";
+   "vgetexp<ssescalarmodesuffix>\t{<round_saeonly_scalar_mask_op3>%2, %1, %0<mask_scalar_operand3>|%0<mask_scalar_operand3>, %1, %2<round_saeonly_scalar_mask_op3>}";
     [(set_attr "prefix" "evex")
      (set_attr "mode" "<ssescalarmode>")])
 
   [(set_attr "prefix" "evex")
    (set_attr "mode" "<MODE>")])
 
-(define_insn "avx512f_vgetmant<mode><round_saeonly_name>"
+(define_insn "avx512f_vgetmant<mode><mask_scalar_name><round_saeonly_scalar_name>"
   [(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 "<round_saeonly_nimm_predicate>" "<round_saeonly_constraint>")
+            (match_operand:VF_128 2 "<round_saeonly_scalar_nimm_predicate>" "<round_saeonly_scalar_constraint>")
             (match_operand:SI 3 "const_0_to_15_operand")]
            UNSPEC_GETMANT)
          (match_dup 1)
          (const_int 1)))]
    "TARGET_AVX512F"
-   "vgetmant<ssescalarmodesuffix>\t{%3, <round_saeonly_op4>%2, %1, %0|%0, %1, %2<round_saeonly_op4>, %3}";
+   "vgetmant<ssescalarmodesuffix>\t{%3, <round_saeonly_scalar_mask_op4>%2, %1, %0<mask_scalar_operand4>|%0<mask_scalar_operand4>, %1, %2<round_saeonly_scalar_mask_op4>, %3}";
    [(set_attr "prefix" "evex")
    (set_attr "mode" "<ssescalarmode>")])
 
index 1c7306efd3e58b50048a4ccfb054ecb81edda6fe..a318a8d4c8018e4db1a4c0a74a6ae5acbe66a171 100644 (file)
 
 (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)
 
 (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" "" "<round_saeonly_scalar_mask_operand3>")
+(define_subst_attr "round_saeonly_scalar_mask_op4" "round_saeonly_scalar" "" "<round_saeonly_scalar_mask_operand4>")
 (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)
index d629c2bd90d8a9a1411bad6edc63dd7355412027..f4f2c0f17ec17754a07738356c6f2ddb73c0d017 100644 (file)
@@ -1,3 +1,47 @@
+2017-07-06  Sebastian Peryt  <sebastian.peryt@intel.com>
+
+       * 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  <christophe.lyon@linaro.org>
 
        * lib/target-supports-dg.exp (dg-require-stack-check): New.
index 8377555f81532d7e0ce90e6fe304b461ca73d1a1..085ba81a672646672977b0dd69fcf1990be82a95 100644 (file)
 #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)
index 63194a38b17a7edae6202105e45a45350e9b0646..226cd9665cad56d1f672f7abd8a39b2eae1cf6a0 100644 (file)
@@ -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 <immintrin.h>
 
 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);
 }
index 4f7c94db9ae2902e7430a1b31bd816536dc66fe4..cb82448725f5137c9451fe3161e3c7a1ae6a5482 100644 (file)
@@ -6,30 +6,61 @@
 
 #include <math.h>
 #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 ();
 }
index 9103e6ad84fe075e638f919d6245fdc2ded24cea..495b93c9c6a0a82fcebba5bff53c142291cf5f53 100644 (file)
@@ -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 <immintrin.h>
 
 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);
 }
index 926f4d87ffb7a9c04738989298cc695f94a3e480..ed193af78d448ef586b7df233098e998696dd077 100644 (file)
@@ -6,30 +6,63 @@
 
 #include <math.h>
 #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 ();
 }
index c501ba6729e17c806175d1ba8d23e1782e80aebe..25a64202ea716d1897185865f26af317b7cb04a2 100644 (file)
@@ -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 <immintrin.h>
 
 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);
 }
index 3a34ca4f05ddfca160c9158ccefa2fd08e32a851..45875b4a92133575eb1bb0f31d00fdacbeae9cfc 100644 (file)
@@ -5,6 +5,10 @@
 
 #include "avx512f-check.h"
 #include <math.h>
+#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 ();
+
 }
index 8ce9d4678067e8a5f2abd7338c96a60b545cf018..00a055ffeeee57a6af407a438ccb4dac9ae6d8d8 100644 (file)
@@ -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 <immintrin.h>
 
 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);
 }
index 7c30ea7d8e66fe1c52501d9343905afe7f6cae4a..bcd449b4ae2b7621c7d6d819d19abcbc055df784 100644 (file)
@@ -5,6 +5,10 @@
 
 #include "avx512f-check.h"
 #include <math.h>
+#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 ();
 }
index 79879d7cc162edeee4c312eea6b7f1a9162c7cec..c5c43b12611256c9ab969076e9715d8fe495431a 100644 (file)
 #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)
index 547314aef077f89255263a7effdc89b1406a3c69..c2a19b3ccef4cc2339e81af37b954df994a9cae5 100644 (file)
@@ -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)
index b8a35d11c45017aab21ba567444d9b8692b6533c..cd8945be1cbd3263214c03da5473249bb3e5ee1e 100644 (file)
@@ -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)
index 96c663b64d33949b72ee3923f4b90018f279a21b..fc339a51e63861813e29c5b7885994a592be12a8 100644 (file)
 #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)
index c2bf0dbabd139a2f5224ca3df2078a1885401f92..d0e9b42f2fef74e27be702f3834e82416f79fd41 100644 (file)
@@ -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" } */
 }
index 2c1338164f5c2c235ecb8882c44e526baf57d152..d5ab95c208ed0b2a5b9d0e5285e99ebb5783f9e1 100644 (file)
@@ -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" } */