diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
commit | 486754660bb926339aefcf012a3f848592babb8b (patch) | |
tree | ecdbc446c9876f4f120f701c243373cd3cb43db3 /lib/Headers/avx512dqintrin.h | |
parent | 55e6d896ad333f07bb3b1ba487df214fc268a4ab (diff) | |
download | src-486754660bb926339aefcf012a3f848592babb8b.tar.gz src-486754660bb926339aefcf012a3f848592babb8b.zip |
Vendor import of clang trunk r338150:vendor/clang/clang-trunk-r338150
Notes
Notes:
svn path=/vendor/clang/dist/; revision=336815
svn path=/vendor/clang/clang-trunk-r338150/; revision=336816; tag=vendor/clang/clang-trunk-r338150
Diffstat (limited to 'lib/Headers/avx512dqintrin.h')
-rw-r--r-- | lib/Headers/avx512dqintrin.h | 660 |
1 files changed, 295 insertions, 365 deletions
diff --git a/lib/Headers/avx512dqintrin.h b/lib/Headers/avx512dqintrin.h index 2c431d9740cd..8a00b3afa9d5 100644 --- a/lib/Headers/avx512dqintrin.h +++ b/lib/Headers/avx512dqintrin.h @@ -29,7 +29,7 @@ #define __AVX512DQINTRIN_H /* Define the default attributes for the functions in this file. */ -#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512dq"))) +#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512dq"), __min_vector_width__(512))) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mullo_epi64 (__m512i __A, __m512i __B) { @@ -226,20 +226,20 @@ _mm512_maskz_cvtpd_epi64 (__mmask8 __U, __m512d __A) { _MM_FROUND_CUR_DIRECTION); } -#define _mm512_cvt_roundpd_epi64(A, R) __extension__ ({ \ +#define _mm512_cvt_roundpd_epi64(A, R) \ (__m512i)__builtin_ia32_cvtpd2qq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_cvt_roundpd_epi64(W, U, A, R) __extension__ ({ \ +#define _mm512_mask_cvt_roundpd_epi64(W, U, A, R) \ (__m512i)__builtin_ia32_cvtpd2qq512_mask((__v8df)(__m512d)(A), \ (__v8di)(__m512i)(W), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_maskz_cvt_roundpd_epi64(U, A, R) __extension__ ({ \ +#define _mm512_maskz_cvt_roundpd_epi64(U, A, R) \ (__m512i)__builtin_ia32_cvtpd2qq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtpd_epu64 (__m512d __A) { @@ -265,20 +265,20 @@ _mm512_maskz_cvtpd_epu64 (__mmask8 __U, __m512d __A) { _MM_FROUND_CUR_DIRECTION); } -#define _mm512_cvt_roundpd_epu64(A, R) __extension__ ({ \ +#define _mm512_cvt_roundpd_epu64(A, R) \ (__m512i)__builtin_ia32_cvtpd2uqq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_cvt_roundpd_epu64(W, U, A, R) __extension__ ({ \ +#define _mm512_mask_cvt_roundpd_epu64(W, U, A, R) \ (__m512i)__builtin_ia32_cvtpd2uqq512_mask((__v8df)(__m512d)(A), \ (__v8di)(__m512i)(W), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_maskz_cvt_roundpd_epu64(U, A, R) __extension__ ({ \ +#define _mm512_maskz_cvt_roundpd_epu64(U, A, R) \ (__m512i)__builtin_ia32_cvtpd2uqq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtps_epi64 (__m256 __A) { @@ -304,20 +304,20 @@ _mm512_maskz_cvtps_epi64 (__mmask8 __U, __m256 __A) { _MM_FROUND_CUR_DIRECTION); } -#define _mm512_cvt_roundps_epi64(A, R) __extension__ ({ \ +#define _mm512_cvt_roundps_epi64(A, R) \ (__m512i)__builtin_ia32_cvtps2qq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_cvt_roundps_epi64(W, U, A, R) __extension__ ({ \ +#define _mm512_mask_cvt_roundps_epi64(W, U, A, R) \ (__m512i)__builtin_ia32_cvtps2qq512_mask((__v8sf)(__m256)(A), \ (__v8di)(__m512i)(W), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_maskz_cvt_roundps_epi64(U, A, R) __extension__ ({ \ +#define _mm512_maskz_cvt_roundps_epi64(U, A, R) \ (__m512i)__builtin_ia32_cvtps2qq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtps_epu64 (__m256 __A) { @@ -343,60 +343,55 @@ _mm512_maskz_cvtps_epu64 (__mmask8 __U, __m256 __A) { _MM_FROUND_CUR_DIRECTION); } -#define _mm512_cvt_roundps_epu64(A, R) __extension__ ({ \ +#define _mm512_cvt_roundps_epu64(A, R) \ (__m512i)__builtin_ia32_cvtps2uqq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_cvt_roundps_epu64(W, U, A, R) __extension__ ({ \ +#define _mm512_mask_cvt_roundps_epu64(W, U, A, R) \ (__m512i)__builtin_ia32_cvtps2uqq512_mask((__v8sf)(__m256)(A), \ (__v8di)(__m512i)(W), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_maskz_cvt_roundps_epu64(U, A, R) __extension__ ({ \ +#define _mm512_maskz_cvt_roundps_epu64(U, A, R) \ (__m512i)__builtin_ia32_cvtps2uqq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_cvtepi64_pd (__m512i __A) { - return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, - (__v8df) _mm512_setzero_pd(), - (__mmask8) -1, - _MM_FROUND_CUR_DIRECTION); + return (__m512d)__builtin_convertvector((__v8di)__A, __v8df); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_cvtepi64_pd (__m512d __W, __mmask8 __U, __m512i __A) { - return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, - (__v8df) __W, - (__mmask8) __U, - _MM_FROUND_CUR_DIRECTION); + return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, + (__v8df)_mm512_cvtepi64_pd(__A), + (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi64_pd (__mmask8 __U, __m512i __A) { - return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, - (__v8df) _mm512_setzero_pd(), - (__mmask8) __U, - _MM_FROUND_CUR_DIRECTION); + return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, + (__v8df)_mm512_cvtepi64_pd(__A), + (__v8df)_mm512_setzero_pd()); } -#define _mm512_cvt_roundepi64_pd(A, R) __extension__ ({ \ +#define _mm512_cvt_roundepi64_pd(A, R) \ (__m512d)__builtin_ia32_cvtqq2pd512_mask((__v8di)(__m512i)(A), \ (__v8df)_mm512_setzero_pd(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_cvt_roundepi64_pd(W, U, A, R) __extension__ ({ \ +#define _mm512_mask_cvt_roundepi64_pd(W, U, A, R) \ (__m512d)__builtin_ia32_cvtqq2pd512_mask((__v8di)(__m512i)(A), \ (__v8df)(__m512d)(W), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_maskz_cvt_roundepi64_pd(U, A, R) __extension__ ({ \ +#define _mm512_maskz_cvt_roundepi64_pd(U, A, R) \ (__m512d)__builtin_ia32_cvtqq2pd512_mask((__v8di)(__m512i)(A), \ (__v8df)_mm512_setzero_pd(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) static __inline__ __m256 __DEFAULT_FN_ATTRS _mm512_cvtepi64_ps (__m512i __A) { @@ -422,20 +417,20 @@ _mm512_maskz_cvtepi64_ps (__mmask8 __U, __m512i __A) { _MM_FROUND_CUR_DIRECTION); } -#define _mm512_cvt_roundepi64_ps(A, R) __extension__ ({ \ +#define _mm512_cvt_roundepi64_ps(A, R) \ (__m256)__builtin_ia32_cvtqq2ps512_mask((__v8di)(__m512i)(A), \ (__v8sf)_mm256_setzero_ps(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_cvt_roundepi64_ps(W, U, A, R) __extension__ ({ \ +#define _mm512_mask_cvt_roundepi64_ps(W, U, A, R) \ (__m256)__builtin_ia32_cvtqq2ps512_mask((__v8di)(__m512i)(A), \ (__v8sf)(__m256)(W), (__mmask8)(U), \ - (int)(R)); }) + (int)(R)) -#define _mm512_maskz_cvt_roundepi64_ps(U, A, R) __extension__ ({ \ +#define _mm512_maskz_cvt_roundepi64_ps(U, A, R) \ (__m256)__builtin_ia32_cvtqq2ps512_mask((__v8di)(__m512i)(A), \ (__v8sf)_mm256_setzero_ps(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) static __inline__ __m512i __DEFAULT_FN_ATTRS @@ -462,20 +457,20 @@ _mm512_maskz_cvttpd_epi64 (__mmask8 __U, __m512d __A) { _MM_FROUND_CUR_DIRECTION); } -#define _mm512_cvtt_roundpd_epi64(A, R) __extension__ ({ \ +#define _mm512_cvtt_roundpd_epi64(A, R) \ (__m512i)__builtin_ia32_cvttpd2qq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_cvtt_roundpd_epi64(W, U, A, R) __extension__ ({ \ +#define _mm512_mask_cvtt_roundpd_epi64(W, U, A, R) \ (__m512i)__builtin_ia32_cvttpd2qq512_mask((__v8df)(__m512d)(A), \ (__v8di)(__m512i)(W), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_maskz_cvtt_roundpd_epi64(U, A, R) __extension__ ({ \ +#define _mm512_maskz_cvtt_roundpd_epi64(U, A, R) \ (__m512i)__builtin_ia32_cvttpd2qq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvttpd_epu64 (__m512d __A) { @@ -501,20 +496,20 @@ _mm512_maskz_cvttpd_epu64 (__mmask8 __U, __m512d __A) { _MM_FROUND_CUR_DIRECTION); } -#define _mm512_cvtt_roundpd_epu64(A, R) __extension__ ({ \ +#define _mm512_cvtt_roundpd_epu64(A, R) \ (__m512i)__builtin_ia32_cvttpd2uqq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_cvtt_roundpd_epu64(W, U, A, R) __extension__ ({ \ +#define _mm512_mask_cvtt_roundpd_epu64(W, U, A, R) \ (__m512i)__builtin_ia32_cvttpd2uqq512_mask((__v8df)(__m512d)(A), \ (__v8di)(__m512i)(W), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_maskz_cvtt_roundpd_epu64(U, A, R) __extension__ ({ \ +#define _mm512_maskz_cvtt_roundpd_epu64(U, A, R) \ (__m512i)__builtin_ia32_cvttpd2uqq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvttps_epi64 (__m256 __A) { @@ -540,20 +535,20 @@ _mm512_maskz_cvttps_epi64 (__mmask8 __U, __m256 __A) { _MM_FROUND_CUR_DIRECTION); } -#define _mm512_cvtt_roundps_epi64(A, R) __extension__ ({ \ +#define _mm512_cvtt_roundps_epi64(A, R) \ (__m512i)__builtin_ia32_cvttps2qq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_cvtt_roundps_epi64(W, U, A, R) __extension__ ({ \ +#define _mm512_mask_cvtt_roundps_epi64(W, U, A, R) \ (__m512i)__builtin_ia32_cvttps2qq512_mask((__v8sf)(__m256)(A), \ (__v8di)(__m512i)(W), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_maskz_cvtt_roundps_epi64(U, A, R) __extension__ ({ \ +#define _mm512_maskz_cvtt_roundps_epi64(U, A, R) \ (__m512i)__builtin_ia32_cvttps2qq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvttps_epu64 (__m256 __A) { @@ -579,60 +574,55 @@ _mm512_maskz_cvttps_epu64 (__mmask8 __U, __m256 __A) { _MM_FROUND_CUR_DIRECTION); } -#define _mm512_cvtt_roundps_epu64(A, R) __extension__ ({ \ +#define _mm512_cvtt_roundps_epu64(A, R) \ (__m512i)__builtin_ia32_cvttps2uqq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_cvtt_roundps_epu64(W, U, A, R) __extension__ ({ \ +#define _mm512_mask_cvtt_roundps_epu64(W, U, A, R) \ (__m512i)__builtin_ia32_cvttps2uqq512_mask((__v8sf)(__m256)(A), \ (__v8di)(__m512i)(W), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_maskz_cvtt_roundps_epu64(U, A, R) __extension__ ({ \ +#define _mm512_maskz_cvtt_roundps_epu64(U, A, R) \ (__m512i)__builtin_ia32_cvttps2uqq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_cvtepu64_pd (__m512i __A) { - return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, - (__v8df) _mm512_setzero_pd(), - (__mmask8) -1, - _MM_FROUND_CUR_DIRECTION); + return (__m512d)__builtin_convertvector((__v8du)__A, __v8df); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_cvtepu64_pd (__m512d __W, __mmask8 __U, __m512i __A) { - return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, - (__v8df) __W, - (__mmask8) __U, - _MM_FROUND_CUR_DIRECTION); + return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, + (__v8df)_mm512_cvtepu64_pd(__A), + (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_cvtepu64_pd (__mmask8 __U, __m512i __A) { - return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, - (__v8df) _mm512_setzero_pd(), - (__mmask8) __U, - _MM_FROUND_CUR_DIRECTION); + return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, + (__v8df)_mm512_cvtepu64_pd(__A), + (__v8df)_mm512_setzero_pd()); } -#define _mm512_cvt_roundepu64_pd(A, R) __extension__ ({ \ +#define _mm512_cvt_roundepu64_pd(A, R) \ (__m512d)__builtin_ia32_cvtuqq2pd512_mask((__v8di)(__m512i)(A), \ (__v8df)_mm512_setzero_pd(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_cvt_roundepu64_pd(W, U, A, R) __extension__ ({ \ +#define _mm512_mask_cvt_roundepu64_pd(W, U, A, R) \ (__m512d)__builtin_ia32_cvtuqq2pd512_mask((__v8di)(__m512i)(A), \ (__v8df)(__m512d)(W), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_maskz_cvt_roundepu64_pd(U, A, R) __extension__ ({ \ +#define _mm512_maskz_cvt_roundepu64_pd(U, A, R) \ (__m512d)__builtin_ia32_cvtuqq2pd512_mask((__v8di)(__m512i)(A), \ (__v8df)_mm512_setzero_pd(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) static __inline__ __m256 __DEFAULT_FN_ATTRS @@ -659,292 +649,292 @@ _mm512_maskz_cvtepu64_ps (__mmask8 __U, __m512i __A) { _MM_FROUND_CUR_DIRECTION); } -#define _mm512_cvt_roundepu64_ps(A, R) __extension__ ({ \ +#define _mm512_cvt_roundepu64_ps(A, R) \ (__m256)__builtin_ia32_cvtuqq2ps512_mask((__v8di)(__m512i)(A), \ (__v8sf)_mm256_setzero_ps(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_cvt_roundepu64_ps(W, U, A, R) __extension__ ({ \ +#define _mm512_mask_cvt_roundepu64_ps(W, U, A, R) \ (__m256)__builtin_ia32_cvtuqq2ps512_mask((__v8di)(__m512i)(A), \ (__v8sf)(__m256)(W), (__mmask8)(U), \ - (int)(R)); }) + (int)(R)) -#define _mm512_maskz_cvt_roundepu64_ps(U, A, R) __extension__ ({ \ +#define _mm512_maskz_cvt_roundepu64_ps(U, A, R) \ (__m256)__builtin_ia32_cvtuqq2ps512_mask((__v8di)(__m512i)(A), \ (__v8sf)_mm256_setzero_ps(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_range_pd(A, B, C) __extension__ ({ \ +#define _mm512_range_pd(A, B, C) \ (__m512d)__builtin_ia32_rangepd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(C), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm512_mask_range_pd(W, U, A, B, C) __extension__ ({ \ +#define _mm512_mask_range_pd(W, U, A, B, C) \ (__m512d)__builtin_ia32_rangepd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(C), \ (__v8df)(__m512d)(W), (__mmask8)(U), \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm512_maskz_range_pd(U, A, B, C) __extension__ ({ \ +#define _mm512_maskz_range_pd(U, A, B, C) \ (__m512d)__builtin_ia32_rangepd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(C), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm512_range_round_pd(A, B, C, R) __extension__ ({ \ +#define _mm512_range_round_pd(A, B, C, R) \ (__m512d)__builtin_ia32_rangepd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(C), \ (__v8df)_mm512_setzero_pd(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_range_round_pd(W, U, A, B, C, R) __extension__ ({ \ +#define _mm512_mask_range_round_pd(W, U, A, B, C, R) \ (__m512d)__builtin_ia32_rangepd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(C), \ (__v8df)(__m512d)(W), (__mmask8)(U), \ - (int)(R)); }) + (int)(R)) -#define _mm512_maskz_range_round_pd(U, A, B, C, R) __extension__ ({ \ +#define _mm512_maskz_range_round_pd(U, A, B, C, R) \ (__m512d)__builtin_ia32_rangepd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(C), \ (__v8df)_mm512_setzero_pd(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_range_ps(A, B, C) __extension__ ({ \ +#define _mm512_range_ps(A, B, C) \ (__m512)__builtin_ia32_rangeps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(C), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm512_mask_range_ps(W, U, A, B, C) __extension__ ({ \ +#define _mm512_mask_range_ps(W, U, A, B, C) \ (__m512)__builtin_ia32_rangeps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(C), \ (__v16sf)(__m512)(W), (__mmask16)(U), \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm512_maskz_range_ps(U, A, B, C) __extension__ ({ \ +#define _mm512_maskz_range_ps(U, A, B, C) \ (__m512)__builtin_ia32_rangeps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(C), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm512_range_round_ps(A, B, C, R) __extension__ ({ \ +#define _mm512_range_round_ps(A, B, C, R) \ (__m512)__builtin_ia32_rangeps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(C), \ (__v16sf)_mm512_setzero_ps(), \ - (__mmask16)-1, (int)(R)); }) + (__mmask16)-1, (int)(R)) -#define _mm512_mask_range_round_ps(W, U, A, B, C, R) __extension__ ({ \ +#define _mm512_mask_range_round_ps(W, U, A, B, C, R) \ (__m512)__builtin_ia32_rangeps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(C), \ (__v16sf)(__m512)(W), (__mmask16)(U), \ - (int)(R)); }) + (int)(R)) -#define _mm512_maskz_range_round_ps(U, A, B, C, R) __extension__ ({ \ +#define _mm512_maskz_range_round_ps(U, A, B, C, R) \ (__m512)__builtin_ia32_rangeps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(C), \ (__v16sf)_mm512_setzero_ps(), \ - (__mmask16)(U), (int)(R)); }) + (__mmask16)(U), (int)(R)) -#define _mm_range_round_ss(A, B, C, R) __extension__ ({ \ +#define _mm_range_round_ss(A, B, C, R) \ (__m128)__builtin_ia32_rangess128_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8) -1, (int)(C),\ - (int)(R)); }) + (int)(R)) #define _mm_range_ss(A ,B , C) _mm_range_round_ss(A, B, C ,_MM_FROUND_CUR_DIRECTION) -#define _mm_mask_range_round_ss(W, U, A, B, C, R) __extension__ ({ \ +#define _mm_mask_range_round_ss(W, U, A, B, C, R) \ (__m128)__builtin_ia32_rangess128_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W),\ (__mmask8)(U), (int)(C),\ - (int)(R)); }) + (int)(R)) #define _mm_mask_range_ss(W , U, A, B, C) _mm_mask_range_round_ss(W, U, A, B, C , _MM_FROUND_CUR_DIRECTION) -#define _mm_maskz_range_round_ss(U, A, B, C, R) __extension__ ({ \ +#define _mm_maskz_range_round_ss(U, A, B, C, R) \ (__m128)__builtin_ia32_rangess128_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(C),\ - (int)(R)); }) + (int)(R)) #define _mm_maskz_range_ss(U, A ,B , C) _mm_maskz_range_round_ss(U, A, B, C ,_MM_FROUND_CUR_DIRECTION) -#define _mm_range_round_sd(A, B, C, R) __extension__ ({ \ +#define _mm_range_round_sd(A, B, C, R) \ (__m128d)__builtin_ia32_rangesd128_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8) -1, (int)(C),\ - (int)(R)); }) + (int)(R)) #define _mm_range_sd(A ,B , C) _mm_range_round_sd(A, B, C ,_MM_FROUND_CUR_DIRECTION) -#define _mm_mask_range_round_sd(W, U, A, B, C, R) __extension__ ({ \ +#define _mm_mask_range_round_sd(W, U, A, B, C, R) \ (__m128d)__builtin_ia32_rangesd128_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W),\ (__mmask8)(U), (int)(C),\ - (int)(R)); }) + (int)(R)) #define _mm_mask_range_sd(W, U, A, B, C) _mm_mask_range_round_sd(W, U, A, B, C ,_MM_FROUND_CUR_DIRECTION) -#define _mm_maskz_range_round_sd(U, A, B, C, R) __extension__ ({ \ +#define _mm_maskz_range_round_sd(U, A, B, C, R) \ (__m128d)__builtin_ia32_rangesd128_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(C),\ - (int)(R)); }) + (int)(R)) #define _mm_maskz_range_sd(U, A, B, C) _mm_maskz_range_round_sd(U, A, B, C ,_MM_FROUND_CUR_DIRECTION) -#define _mm512_reduce_pd(A, B) __extension__ ({ \ +#define _mm512_reduce_pd(A, B) \ (__m512d)__builtin_ia32_reducepd512_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm512_mask_reduce_pd(W, U, A, B) __extension__ ({ \ +#define _mm512_mask_reduce_pd(W, U, A, B) \ (__m512d)__builtin_ia32_reducepd512_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)(__m512d)(W), \ (__mmask8)(U), \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm512_maskz_reduce_pd(U, A, B) __extension__ ({ \ +#define _mm512_maskz_reduce_pd(U, A, B) \ (__m512d)__builtin_ia32_reducepd512_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm512_reduce_ps(A, B) __extension__ ({ \ +#define _mm512_reduce_ps(A, B) \ (__m512)__builtin_ia32_reduceps512_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm512_mask_reduce_ps(W, U, A, B) __extension__ ({ \ +#define _mm512_mask_reduce_ps(W, U, A, B) \ (__m512)__builtin_ia32_reduceps512_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)(__m512)(W), \ (__mmask16)(U), \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm512_maskz_reduce_ps(U, A, B) __extension__ ({ \ +#define _mm512_maskz_reduce_ps(U, A, B) \ (__m512)__builtin_ia32_reduceps512_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm512_reduce_round_pd(A, B, R) __extension__ ({\ +#define _mm512_reduce_round_pd(A, B, R) \ (__m512d)__builtin_ia32_reducepd512_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)_mm512_setzero_pd(), \ - (__mmask8)-1, (int)(R)); }) + (__mmask8)-1, (int)(R)) -#define _mm512_mask_reduce_round_pd(W, U, A, B, R) __extension__ ({\ +#define _mm512_mask_reduce_round_pd(W, U, A, B, R) \ (__m512d)__builtin_ia32_reducepd512_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)(__m512d)(W), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_maskz_reduce_round_pd(U, A, B, R) __extension__ ({\ +#define _mm512_maskz_reduce_round_pd(U, A, B, R) \ (__m512d)__builtin_ia32_reducepd512_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)_mm512_setzero_pd(), \ - (__mmask8)(U), (int)(R)); }) + (__mmask8)(U), (int)(R)) -#define _mm512_reduce_round_ps(A, B, R) __extension__ ({\ +#define _mm512_reduce_round_ps(A, B, R) \ (__m512)__builtin_ia32_reduceps512_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)_mm512_setzero_ps(), \ - (__mmask16)-1, (int)(R)); }) + (__mmask16)-1, (int)(R)) -#define _mm512_mask_reduce_round_ps(W, U, A, B, R) __extension__ ({\ +#define _mm512_mask_reduce_round_ps(W, U, A, B, R) \ (__m512)__builtin_ia32_reduceps512_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)(__m512)(W), \ - (__mmask16)(U), (int)(R)); }) + (__mmask16)(U), (int)(R)) -#define _mm512_maskz_reduce_round_ps(U, A, B, R) __extension__ ({\ +#define _mm512_maskz_reduce_round_ps(U, A, B, R) \ (__m512)__builtin_ia32_reduceps512_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)_mm512_setzero_ps(), \ - (__mmask16)(U), (int)(R)); }) + (__mmask16)(U), (int)(R)) -#define _mm_reduce_ss(A, B, C) __extension__ ({ \ +#define _mm_reduce_ss(A, B, C) \ (__m128)__builtin_ia32_reducess_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), (__mmask8)-1, \ - (int)(C), _MM_FROUND_CUR_DIRECTION); }) + (int)(C), _MM_FROUND_CUR_DIRECTION) -#define _mm_mask_reduce_ss(W, U, A, B, C) __extension__ ({ \ +#define _mm_mask_reduce_ss(W, U, A, B, C) \ (__m128)__builtin_ia32_reducess_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), (__mmask8)(U), \ - (int)(C), _MM_FROUND_CUR_DIRECTION); }) + (int)(C), _MM_FROUND_CUR_DIRECTION) -#define _mm_maskz_reduce_ss(U, A, B, C) __extension__ ({ \ +#define _mm_maskz_reduce_ss(U, A, B, C) \ (__m128)__builtin_ia32_reducess_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(C), \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm_reduce_round_ss(A, B, C, R) __extension__ ({ \ +#define _mm_reduce_round_ss(A, B, C, R) \ (__m128)__builtin_ia32_reducess_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), (__mmask8)-1, \ - (int)(C), (int)(R)); }) + (int)(C), (int)(R)) -#define _mm_mask_reduce_round_ss(W, U, A, B, C, R) __extension__ ({ \ +#define _mm_mask_reduce_round_ss(W, U, A, B, C, R) \ (__m128)__builtin_ia32_reducess_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), (__mmask8)(U), \ - (int)(C), (int)(R)); }) + (int)(C), (int)(R)) -#define _mm_maskz_reduce_round_ss(U, A, B, C, R) __extension__ ({ \ +#define _mm_maskz_reduce_round_ss(U, A, B, C, R) \ (__m128)__builtin_ia32_reducess_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ - (__mmask8)(U), (int)(C), (int)(R)); }) + (__mmask8)(U), (int)(C), (int)(R)) -#define _mm_reduce_sd(A, B, C) __extension__ ({ \ +#define _mm_reduce_sd(A, B, C) \ (__m128d)__builtin_ia32_reducesd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(C), \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm_mask_reduce_sd(W, U, A, B, C) __extension__ ({ \ +#define _mm_mask_reduce_sd(W, U, A, B, C) \ (__m128d)__builtin_ia32_reducesd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), (__mmask8)(U), \ - (int)(C), _MM_FROUND_CUR_DIRECTION); }) + (int)(C), _MM_FROUND_CUR_DIRECTION) -#define _mm_maskz_reduce_sd(U, A, B, C) __extension__ ({ \ +#define _mm_maskz_reduce_sd(U, A, B, C) \ (__m128d)__builtin_ia32_reducesd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(C), \ - _MM_FROUND_CUR_DIRECTION); }) + _MM_FROUND_CUR_DIRECTION) -#define _mm_reduce_round_sd(A, B, C, R) __extension__ ({ \ +#define _mm_reduce_round_sd(A, B, C, R) \ (__m128d)__builtin_ia32_reducesd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ - (__mmask8)-1, (int)(C), (int)(R)); }) + (__mmask8)-1, (int)(C), (int)(R)) -#define _mm_mask_reduce_round_sd(W, U, A, B, C, R) __extension__ ({ \ +#define _mm_mask_reduce_round_sd(W, U, A, B, C, R) \ (__m128d)__builtin_ia32_reducesd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), (__mmask8)(U), \ - (int)(C), (int)(R)); }) + (int)(C), (int)(R)) -#define _mm_maskz_reduce_round_sd(U, A, B, C, R) __extension__ ({ \ +#define _mm_maskz_reduce_round_sd(U, A, B, C, R) \ (__m128d)__builtin_ia32_reducesd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ - (__mmask8)(U), (int)(C), (int)(R)); }) - + (__mmask8)(U), (int)(C), (int)(R)) + static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_movepi32_mask (__m512i __A) { @@ -973,8 +963,7 @@ _mm512_movepi64_mask (__m512i __A) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_broadcast_f32x2 (__m128 __A) { - return (__m512)__builtin_shufflevector((__v4sf)__A, - (__v4sf)_mm_undefined_ps(), + return (__m512)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1); } @@ -1006,7 +995,7 @@ _mm512_broadcast_f32x8(__m256 __A) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_broadcast_f32x8(__m512 __O, __mmask16 __M, __m256 __A) { - return (__m512)__builtin_ia32_selectps_512((__mmask8)__M, + return (__m512)__builtin_ia32_selectps_512((__mmask16)__M, (__v16sf)_mm512_broadcast_f32x8(__A), (__v16sf)__O); } @@ -1014,7 +1003,7 @@ _mm512_mask_broadcast_f32x8(__m512 __O, __mmask16 __M, __m256 __A) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_broadcast_f32x8(__mmask16 __M, __m256 __A) { - return (__m512)__builtin_ia32_selectps_512((__mmask8)__M, + return (__m512)__builtin_ia32_selectps_512((__mmask16)__M, (__v16sf)_mm512_broadcast_f32x8(__A), (__v16sf)_mm512_setzero_ps()); } @@ -1045,8 +1034,7 @@ _mm512_maskz_broadcast_f64x2(__mmask8 __M, __m128d __A) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_broadcast_i32x2 (__m128i __A) { - return (__m512i)__builtin_shufflevector((__v4si)__A, - (__v4si)_mm_undefined_si128(), + return (__m512i)__builtin_shufflevector((__v4si)__A, (__v4si)__A, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1); } @@ -1078,7 +1066,7 @@ _mm512_broadcast_i32x8(__m256i __A) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_broadcast_i32x8(__m512i __O, __mmask16 __M, __m256i __A) { - return (__m512i)__builtin_ia32_selectd_512((__mmask8)__M, + return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M, (__v16si)_mm512_broadcast_i32x8(__A), (__v16si)__O); } @@ -1086,7 +1074,7 @@ _mm512_mask_broadcast_i32x8(__m512i __O, __mmask16 __M, __m256i __A) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_broadcast_i32x8(__mmask16 __M, __m256i __A) { - return (__m512i)__builtin_ia32_selectd_512((__mmask8)__M, + return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M, (__v16si)_mm512_broadcast_i32x8(__A), (__v16si)_mm512_setzero_si512()); } @@ -1114,217 +1102,159 @@ _mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A) (__v8di)_mm512_setzero_si512()); } -#define _mm512_extractf32x8_ps(A, imm) __extension__ ({ \ - (__m256)__builtin_shufflevector((__v16sf)(__m512)(A), \ - (__v16sf)_mm512_undefined_ps(), \ - ((imm) & 1) ? 8 : 0, \ - ((imm) & 1) ? 9 : 1, \ - ((imm) & 1) ? 10 : 2, \ - ((imm) & 1) ? 11 : 3, \ - ((imm) & 1) ? 12 : 4, \ - ((imm) & 1) ? 13 : 5, \ - ((imm) & 1) ? 14 : 6, \ - ((imm) & 1) ? 15 : 7); }) - -#define _mm512_mask_extractf32x8_ps(W, U, A, imm) __extension__ ({ \ - (__m256)__builtin_ia32_selectps_256((__mmask8)(U), \ - (__v8sf)_mm512_extractf32x8_ps((A), (imm)), \ - (__v8sf)(W)); }) - -#define _mm512_maskz_extractf32x8_ps(U, A, imm) __extension__ ({ \ - (__m256)__builtin_ia32_selectps_256((__mmask8)(U), \ - (__v8sf)_mm512_extractf32x8_ps((A), (imm)), \ - (__v8sf)_mm256_setzero_ps()); }) - -#define _mm512_extractf64x2_pd(A, imm) __extension__ ({ \ - (__m128d)__builtin_shufflevector((__v8df)(__m512d)(A), \ - (__v8df)_mm512_undefined_pd(), \ - 0 + ((imm) & 0x3) * 2, \ - 1 + ((imm) & 0x3) * 2); }) - -#define _mm512_mask_extractf64x2_pd(W, U, A, imm) __extension__ ({ \ - (__m128d)__builtin_ia32_selectpd_128((__mmask8)(U), \ - (__v2df)_mm512_extractf64x2_pd((A), (imm)), \ - (__v2df)(W)); }) - -#define _mm512_maskz_extractf64x2_pd(U, A, imm) __extension__ ({ \ - (__m128d)__builtin_ia32_selectpd_128((__mmask8)(U), \ - (__v2df)_mm512_extractf64x2_pd((A), (imm)), \ - (__v2df)_mm_setzero_pd()); }) - -#define _mm512_extracti32x8_epi32(A, imm) __extension__ ({ \ - (__m256i)__builtin_shufflevector((__v16si)(__m512i)(A), \ - (__v16si)_mm512_undefined_epi32(), \ - ((imm) & 1) ? 8 : 0, \ - ((imm) & 1) ? 9 : 1, \ - ((imm) & 1) ? 10 : 2, \ - ((imm) & 1) ? 11 : 3, \ - ((imm) & 1) ? 12 : 4, \ - ((imm) & 1) ? 13 : 5, \ - ((imm) & 1) ? 14 : 6, \ - ((imm) & 1) ? 15 : 7); }) - -#define _mm512_mask_extracti32x8_epi32(W, U, A, imm) __extension__ ({ \ - (__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \ - (__v8si)_mm512_extracti32x8_epi32((A), (imm)), \ - (__v8si)(W)); }) - -#define _mm512_maskz_extracti32x8_epi32(U, A, imm) __extension__ ({ \ - (__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \ - (__v8si)_mm512_extracti32x8_epi32((A), (imm)), \ - (__v8si)_mm256_setzero_si256()); }) - -#define _mm512_extracti64x2_epi64(A, imm) __extension__ ({ \ - (__m128i)__builtin_shufflevector((__v8di)(__m512i)(A), \ - (__v8di)_mm512_undefined_epi32(), \ - 0 + ((imm) & 0x3) * 2, \ - 1 + ((imm) & 0x3) * 2); }) - -#define _mm512_mask_extracti64x2_epi64(W, U, A, imm) __extension__ ({ \ - (__m128d)__builtin_ia32_selectq_128((__mmask8)(U), \ - (__v2di)_mm512_extracti64x2_epi64((A), (imm)), \ - (__v2di)(W)); }) - -#define _mm512_maskz_extracti64x2_epi64(U, A, imm) __extension__ ({ \ - (__m128d)__builtin_ia32_selectq_128((__mmask8)(U), \ - (__v2di)_mm512_extracti64x2_epi64((A), (imm)), \ - (__v2di)_mm_setzero_di()); }) - -#define _mm512_insertf32x8(A, B, imm) __extension__ ({ \ - (__m512)__builtin_shufflevector((__v16sf)(__m512)(A), \ - (__v16sf)_mm512_castps256_ps512((__m256)(B)),\ - ((imm) & 0x1) ? 0 : 16, \ - ((imm) & 0x1) ? 1 : 17, \ - ((imm) & 0x1) ? 2 : 18, \ - ((imm) & 0x1) ? 3 : 19, \ - ((imm) & 0x1) ? 4 : 20, \ - ((imm) & 0x1) ? 5 : 21, \ - ((imm) & 0x1) ? 6 : 22, \ - ((imm) & 0x1) ? 7 : 23, \ - ((imm) & 0x1) ? 16 : 8, \ - ((imm) & 0x1) ? 17 : 9, \ - ((imm) & 0x1) ? 18 : 10, \ - ((imm) & 0x1) ? 19 : 11, \ - ((imm) & 0x1) ? 20 : 12, \ - ((imm) & 0x1) ? 21 : 13, \ - ((imm) & 0x1) ? 22 : 14, \ - ((imm) & 0x1) ? 23 : 15); }) - -#define _mm512_mask_insertf32x8(W, U, A, B, imm) __extension__ ({ \ +#define _mm512_extractf32x8_ps(A, imm) \ + (__m256)__builtin_ia32_extractf32x8_mask((__v16sf)(__m512)(A), (int)(imm), \ + (__v8sf)_mm256_undefined_ps(), \ + (__mmask8)-1) + +#define _mm512_mask_extractf32x8_ps(W, U, A, imm) \ + (__m256)__builtin_ia32_extractf32x8_mask((__v16sf)(__m512)(A), (int)(imm), \ + (__v8sf)(__m256)(W), \ + (__mmask8)(U)) + +#define _mm512_maskz_extractf32x8_ps(U, A, imm) \ + (__m256)__builtin_ia32_extractf32x8_mask((__v16sf)(__m512)(A), (int)(imm), \ + (__v8sf)_mm256_setzero_ps(), \ + (__mmask8)(U)) + +#define _mm512_extractf64x2_pd(A, imm) \ + (__m128d)__builtin_ia32_extractf64x2_512_mask((__v8df)(__m512d)(A), \ + (int)(imm), \ + (__v2df)_mm_undefined_pd(), \ + (__mmask8)-1) + +#define _mm512_mask_extractf64x2_pd(W, U, A, imm) \ + (__m128d)__builtin_ia32_extractf64x2_512_mask((__v8df)(__m512d)(A), \ + (int)(imm), \ + (__v2df)(__m128d)(W), \ + (__mmask8)(U)) + +#define _mm512_maskz_extractf64x2_pd(U, A, imm) \ + (__m128d)__builtin_ia32_extractf64x2_512_mask((__v8df)(__m512d)(A), \ + (int)(imm), \ + (__v2df)_mm_setzero_pd(), \ + (__mmask8)(U)) + +#define _mm512_extracti32x8_epi32(A, imm) \ + (__m256i)__builtin_ia32_extracti32x8_mask((__v16si)(__m512i)(A), (int)(imm), \ + (__v8si)_mm256_undefined_si256(), \ + (__mmask8)-1) + +#define _mm512_mask_extracti32x8_epi32(W, U, A, imm) \ + (__m256i)__builtin_ia32_extracti32x8_mask((__v16si)(__m512i)(A), (int)(imm), \ + (__v8si)(__m256i)(W), \ + (__mmask8)(U)) + +#define _mm512_maskz_extracti32x8_epi32(U, A, imm) \ + (__m256i)__builtin_ia32_extracti32x8_mask((__v16si)(__m512i)(A), (int)(imm), \ + (__v8si)_mm256_setzero_si256(), \ + (__mmask8)(U)) + +#define _mm512_extracti64x2_epi64(A, imm) \ + (__m128i)__builtin_ia32_extracti64x2_512_mask((__v8di)(__m512i)(A), \ + (int)(imm), \ + (__v2di)_mm_undefined_si128(), \ + (__mmask8)-1) + +#define _mm512_mask_extracti64x2_epi64(W, U, A, imm) \ + (__m128i)__builtin_ia32_extracti64x2_512_mask((__v8di)(__m512i)(A), \ + (int)(imm), \ + (__v2di)(__m128i)(W), \ + (__mmask8)(U)) + +#define _mm512_maskz_extracti64x2_epi64(U, A, imm) \ + (__m128i)__builtin_ia32_extracti64x2_512_mask((__v8di)(__m512i)(A), \ + (int)(imm), \ + (__v2di)_mm_setzero_si128(), \ + (__mmask8)(U)) + +#define _mm512_insertf32x8(A, B, imm) \ + (__m512)__builtin_ia32_insertf32x8((__v16sf)(__m512)(A), \ + (__v8sf)(__m256)(B), (int)(imm)) + +#define _mm512_mask_insertf32x8(W, U, A, B, imm) \ (__m512)__builtin_ia32_selectps_512((__mmask16)(U), \ (__v16sf)_mm512_insertf32x8((A), (B), (imm)), \ - (__v16sf)(W)); }) + (__v16sf)(__m512)(W)) -#define _mm512_maskz_insertf32x8(U, A, B, imm) __extension__ ({ \ +#define _mm512_maskz_insertf32x8(U, A, B, imm) \ (__m512)__builtin_ia32_selectps_512((__mmask16)(U), \ (__v16sf)_mm512_insertf32x8((A), (B), (imm)), \ - (__v16sf)_mm512_setzero_ps()); }) - -#define _mm512_insertf64x2(A, B, imm) __extension__ ({ \ - (__m512d)__builtin_shufflevector((__v8df)(__m512d)(A), \ - (__v8df)_mm512_castpd128_pd512((__m128d)(B)),\ - (((imm) & 0x3) == 0) ? 8 : 0, \ - (((imm) & 0x3) == 0) ? 9 : 1, \ - (((imm) & 0x3) == 1) ? 8 : 2, \ - (((imm) & 0x3) == 1) ? 9 : 3, \ - (((imm) & 0x3) == 2) ? 8 : 4, \ - (((imm) & 0x3) == 2) ? 9 : 5, \ - (((imm) & 0x3) == 3) ? 8 : 6, \ - (((imm) & 0x3) == 3) ? 9 : 7); }) - -#define _mm512_mask_insertf64x2(W, U, A, B, imm) __extension__ ({ \ + (__v16sf)_mm512_setzero_ps()) + +#define _mm512_insertf64x2(A, B, imm) \ + (__m512d)__builtin_ia32_insertf64x2_512((__v8df)(__m512d)(A), \ + (__v2df)(__m128d)(B), (int)(imm)) + +#define _mm512_mask_insertf64x2(W, U, A, B, imm) \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_insertf64x2((A), (B), (imm)), \ - (__v8df)(W)); }) + (__v8df)(__m512d)(W)) -#define _mm512_maskz_insertf64x2(U, A, B, imm) __extension__ ({ \ +#define _mm512_maskz_insertf64x2(U, A, B, imm) \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_insertf64x2((A), (B), (imm)), \ - (__v8df)_mm512_setzero_pd()); }) - -#define _mm512_inserti32x8(A, B, imm) __extension__ ({ \ - (__m512i)__builtin_shufflevector((__v16si)(__m512i)(A), \ - (__v16si)_mm512_castsi256_si512((__m256i)(B)),\ - ((imm) & 0x1) ? 0 : 16, \ - ((imm) & 0x1) ? 1 : 17, \ - ((imm) & 0x1) ? 2 : 18, \ - ((imm) & 0x1) ? 3 : 19, \ - ((imm) & 0x1) ? 4 : 20, \ - ((imm) & 0x1) ? 5 : 21, \ - ((imm) & 0x1) ? 6 : 22, \ - ((imm) & 0x1) ? 7 : 23, \ - ((imm) & 0x1) ? 16 : 8, \ - ((imm) & 0x1) ? 17 : 9, \ - ((imm) & 0x1) ? 18 : 10, \ - ((imm) & 0x1) ? 19 : 11, \ - ((imm) & 0x1) ? 20 : 12, \ - ((imm) & 0x1) ? 21 : 13, \ - ((imm) & 0x1) ? 22 : 14, \ - ((imm) & 0x1) ? 23 : 15); }) - -#define _mm512_mask_inserti32x8(W, U, A, B, imm) __extension__ ({ \ + (__v8df)_mm512_setzero_pd()) + +#define _mm512_inserti32x8(A, B, imm) \ + (__m512i)__builtin_ia32_inserti32x8((__v16si)(__m512i)(A), \ + (__v8si)(__m256i)(B), (int)(imm)) + +#define _mm512_mask_inserti32x8(W, U, A, B, imm) \ (__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \ (__v16si)_mm512_inserti32x8((A), (B), (imm)), \ - (__v16si)(W)); }) + (__v16si)(__m512i)(W)) -#define _mm512_maskz_inserti32x8(U, A, B, imm) __extension__ ({ \ +#define _mm512_maskz_inserti32x8(U, A, B, imm) \ (__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \ (__v16si)_mm512_inserti32x8((A), (B), (imm)), \ - (__v16si)_mm512_setzero_si512()); }) - -#define _mm512_inserti64x2(A, B, imm) __extension__ ({ \ - (__m512i)__builtin_shufflevector((__v8di)(__m512i)(A), \ - (__v8di)_mm512_castsi128_si512((__m128i)(B)),\ - (((imm) & 0x3) == 0) ? 8 : 0, \ - (((imm) & 0x3) == 0) ? 9 : 1, \ - (((imm) & 0x3) == 1) ? 8 : 2, \ - (((imm) & 0x3) == 1) ? 9 : 3, \ - (((imm) & 0x3) == 2) ? 8 : 4, \ - (((imm) & 0x3) == 2) ? 9 : 5, \ - (((imm) & 0x3) == 3) ? 8 : 6, \ - (((imm) & 0x3) == 3) ? 9 : 7); }) - -#define _mm512_mask_inserti64x2(W, U, A, B, imm) __extension__ ({ \ + (__v16si)_mm512_setzero_si512()) + +#define _mm512_inserti64x2(A, B, imm) \ + (__m512i)__builtin_ia32_inserti64x2_512((__v8di)(__m512i)(A), \ + (__v2di)(__m128i)(B), (int)(imm)) + +#define _mm512_mask_inserti64x2(W, U, A, B, imm) \ (__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \ (__v8di)_mm512_inserti64x2((A), (B), (imm)), \ - (__v8di)(W)); }) + (__v8di)(__m512i)(W)) -#define _mm512_maskz_inserti64x2(U, A, B, imm) __extension__ ({ \ +#define _mm512_maskz_inserti64x2(U, A, B, imm) \ (__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \ (__v8di)_mm512_inserti64x2((A), (B), (imm)), \ - (__v8di)_mm512_setzero_si512()); }) + (__v8di)_mm512_setzero_si512()) -#define _mm512_mask_fpclass_ps_mask(U, A, imm) __extension__ ({ \ +#define _mm512_mask_fpclass_ps_mask(U, A, imm) \ (__mmask16)__builtin_ia32_fpclassps512_mask((__v16sf)(__m512)(A), \ - (int)(imm), (__mmask16)(U)); }) + (int)(imm), (__mmask16)(U)) -#define _mm512_fpclass_ps_mask(A, imm) __extension__ ({ \ +#define _mm512_fpclass_ps_mask(A, imm) \ (__mmask16)__builtin_ia32_fpclassps512_mask((__v16sf)(__m512)(A), \ - (int)(imm), (__mmask16)-1); }) + (int)(imm), (__mmask16)-1) -#define _mm512_mask_fpclass_pd_mask(U, A, imm) __extension__ ({ \ +#define _mm512_mask_fpclass_pd_mask(U, A, imm) \ (__mmask8)__builtin_ia32_fpclasspd512_mask((__v8df)(__m512d)(A), (int)(imm), \ - (__mmask8)(U)); }) + (__mmask8)(U)) -#define _mm512_fpclass_pd_mask(A, imm) __extension__ ({ \ +#define _mm512_fpclass_pd_mask(A, imm) \ (__mmask8)__builtin_ia32_fpclasspd512_mask((__v8df)(__m512d)(A), (int)(imm), \ - (__mmask8)-1); }) + (__mmask8)-1) -#define _mm_fpclass_sd_mask(A, imm) __extension__ ({ \ +#define _mm_fpclass_sd_mask(A, imm) \ (__mmask8)__builtin_ia32_fpclasssd_mask((__v2df)(__m128d)(A), (int)(imm), \ - (__mmask8)-1); }) + (__mmask8)-1) -#define _mm_mask_fpclass_sd_mask(U, A, imm) __extension__ ({ \ +#define _mm_mask_fpclass_sd_mask(U, A, imm) \ (__mmask8)__builtin_ia32_fpclasssd_mask((__v2df)(__m128d)(A), (int)(imm), \ - (__mmask8)(U)); }) + (__mmask8)(U)) -#define _mm_fpclass_ss_mask(A, imm) __extension__ ({ \ +#define _mm_fpclass_ss_mask(A, imm) \ (__mmask8)__builtin_ia32_fpclassss_mask((__v4sf)(__m128)(A), (int)(imm), \ - (__mmask8)-1); }) + (__mmask8)-1) -#define _mm_mask_fpclass_ss_mask(U, A, imm) __extension__ ({ \ +#define _mm_mask_fpclass_ss_mask(U, A, imm) \ (__mmask8)__builtin_ia32_fpclassss_mask((__v4sf)(__m128)(A), (int)(imm), \ - (__mmask8)(U)); }) + (__mmask8)(U)) #undef __DEFAULT_FN_ATTRS |