Index: include/clang/Basic/BuiltinsX86.def =================================================================== --- include/clang/Basic/BuiltinsX86.def +++ include/clang/Basic/BuiltinsX86.def @@ -1794,6 +1794,30 @@ TARGET_BUILTIN(__builtin_ia32_loadupd256_mask, "V4dV4d*V4dUc","","avx512vl") TARGET_BUILTIN(__builtin_ia32_loadups128_mask, "V4fV4f*V4fUc","","avx512vl") TARGET_BUILTIN(__builtin_ia32_loadups256_mask, "V8fV8f*V8fUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pslld512_mask, "V16iV16iV4iV16iUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_psllq512_mask, "V8LLiV8LLiV2LLiV8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_psllv16si_mask, "V16iV16iV16iV16iUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_psllv8di_mask, "V8LLiV8LLiV8LLiV8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_psrad512_mask, "V16iV16iV4iV16iUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_psraq512_mask, "V8LLiV8LLiV2LLiV8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_psrav16si_mask, "V16iV16iV16iV16iUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_psrav8di_mask, "V8LLiV8LLiV8LLiV8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_psrld512_mask, "V16iV16iV4iV16iUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_psrlq512_mask, "V8LLiV8LLiV2LLiV8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_psrlv16si_mask, "V16iV16iV16iV16iUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_psrlv8di_mask, "V8LLiV8LLiV8LLiV8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pternlogd512_mask, "V16iV16iV16iV16iIiUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pternlogd512_maskz, "V16iV16iV16iV16iIiUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pternlogq512_mask, "V8LLiV8LLiV8LLiV8LLiIiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pternlogq512_maskz, "V8LLiV8LLiV8LLiV8LLiIiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pternlogd128_mask, "V4iV4iV4iV4iIiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogd128_maskz, "V4iV4iV4iV4iIiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogd256_mask, "V8iV8iV8iV8iIiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogd256_maskz, "V8iV8iV8iV8iIiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogq128_mask, "V2LLiV2LLiV2LLiV2LLiIiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogq128_maskz, "V2LLiV2LLiV2LLiV2LLiIiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogq256_mask, "V4LLiV4LLiV4LLiV4LLiIiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogq256_maskz, "V4LLiV4LLiV4LLiV4LLiIiUc","","avx512vl") #undef BUILTIN #undef TARGET_BUILTIN Index: lib/Headers/avx512fintrin.h =================================================================== --- lib/Headers/avx512fintrin.h +++ lib/Headers/avx512fintrin.h @@ -3974,6 +3974,409 @@ __builtin_ia32_vcomiss ((__v4sf) (__A), (__v4sf) (__B), ( __P), ( __R));\ }) +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_sll_epi32 (__m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_pslld512_mask ((__v16si) __A, + (__v4si) __B, + (__v16si) + _mm512_setzero_si512 (), + (__mmask16) -1); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_mask_sll_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_pslld512_mask ((__v16si) __A, + (__v4si) __B, + (__v16si) __W, + (__mmask16) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_maskz_sll_epi32 (__mmask16 __U, __m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_pslld512_mask ((__v16si) __A, + (__v4si) __B, + (__v16si) + _mm512_setzero_si512 (), + (__mmask16) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_sll_epi64 (__m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psllq512_mask ((__v8di) __A, + (__v2di) __B, + (__v8di) + _mm512_setzero_si512 (), + (__mmask8) -1); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_mask_sll_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psllq512_mask ((__v8di) __A, + (__v2di) __B, + (__v8di) __W, + (__mmask8) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_maskz_sll_epi64 (__mmask8 __U, __m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psllq512_mask ((__v8di) __A, + (__v2di) __B, + (__v8di) + _mm512_setzero_si512 (), + (__mmask8) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_sllv_epi32 (__m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psllv16si_mask ((__v16si) __X, + (__v16si) __Y, + (__v16si) + _mm512_setzero_si512 (), + (__mmask16) -1); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_mask_sllv_epi32 (__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psllv16si_mask ((__v16si) __X, + (__v16si) __Y, + (__v16si) __W, + (__mmask16) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_maskz_sllv_epi32 (__mmask16 __U, __m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psllv16si_mask ((__v16si) __X, + (__v16si) __Y, + (__v16si) + _mm512_setzero_si512 (), + (__mmask16) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_sllv_epi64 (__m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psllv8di_mask ((__v8di) __X, + (__v8di) __Y, + (__v8di) + _mm512_undefined_pd (), + (__mmask8) -1); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_mask_sllv_epi64 (__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psllv8di_mask ((__v8di) __X, + (__v8di) __Y, + (__v8di) __W, + (__mmask8) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_maskz_sllv_epi64 (__mmask8 __U, __m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psllv8di_mask ((__v8di) __X, + (__v8di) __Y, + (__v8di) + _mm512_setzero_si512 (), + (__mmask8) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_sra_epi32 (__m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psrad512_mask ((__v16si) __A, + (__v4si) __B, + (__v16si) + _mm512_setzero_si512 (), + (__mmask16) -1); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_mask_sra_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psrad512_mask ((__v16si) __A, + (__v4si) __B, + (__v16si) __W, + (__mmask16) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_maskz_sra_epi32 (__mmask16 __U, __m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psrad512_mask ((__v16si) __A, + (__v4si) __B, + (__v16si) + _mm512_setzero_si512 (), + (__mmask16) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_sra_epi64 (__m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psraq512_mask ((__v8di) __A, + (__v2di) __B, + (__v8di) + _mm512_setzero_si512 (), + (__mmask8) -1); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_mask_sra_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psraq512_mask ((__v8di) __A, + (__v2di) __B, + (__v8di) __W, + (__mmask8) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_maskz_sra_epi64 (__mmask8 __U, __m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psraq512_mask ((__v8di) __A, + (__v2di) __B, + (__v8di) + _mm512_setzero_si512 (), + (__mmask8) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_srav_epi32 (__m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psrav16si_mask ((__v16si) __X, + (__v16si) __Y, + (__v16si) + _mm512_setzero_si512 (), + (__mmask16) -1); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_mask_srav_epi32 (__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psrav16si_mask ((__v16si) __X, + (__v16si) __Y, + (__v16si) __W, + (__mmask16) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_maskz_srav_epi32 (__mmask16 __U, __m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psrav16si_mask ((__v16si) __X, + (__v16si) __Y, + (__v16si) + _mm512_setzero_si512 (), + (__mmask16) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_srav_epi64 (__m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psrav8di_mask ((__v8di) __X, + (__v8di) __Y, + (__v8di) + _mm512_setzero_si512 (), + (__mmask8) -1); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_mask_srav_epi64 (__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psrav8di_mask ((__v8di) __X, + (__v8di) __Y, + (__v8di) __W, + (__mmask8) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_maskz_srav_epi64 (__mmask8 __U, __m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psrav8di_mask ((__v8di) __X, + (__v8di) __Y, + (__v8di) + _mm512_setzero_si512 (), + (__mmask8) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_srl_epi32 (__m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psrld512_mask ((__v16si) __A, + (__v4si) __B, + (__v16si) + _mm512_setzero_si512 (), + (__mmask16) -1); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_mask_srl_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psrld512_mask ((__v16si) __A, + (__v4si) __B, + (__v16si) __W, + (__mmask16) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_maskz_srl_epi32 (__mmask16 __U, __m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psrld512_mask ((__v16si) __A, + (__v4si) __B, + (__v16si) + _mm512_setzero_si512 (), + (__mmask16) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_srl_epi64 (__m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psrlq512_mask ((__v8di) __A, + (__v2di) __B, + (__v8di) + _mm512_setzero_si512 (), + (__mmask8) -1); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_mask_srl_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psrlq512_mask ((__v8di) __A, + (__v2di) __B, + (__v8di) __W, + (__mmask8) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_maskz_srl_epi64 (__mmask8 __U, __m512i __A, __m128i __B) +{ + return (__m512i) __builtin_ia32_psrlq512_mask ((__v8di) __A, + (__v2di) __B, + (__v8di) + _mm512_setzero_si512 (), + (__mmask8) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_srlv_epi32 (__m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psrlv16si_mask ((__v16si) __X, + (__v16si) __Y, + (__v16si) + _mm512_setzero_si512 (), + (__mmask16) -1); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_mask_srlv_epi32 (__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psrlv16si_mask ((__v16si) __X, + (__v16si) __Y, + (__v16si) __W, + (__mmask16) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_maskz_srlv_epi32 (__mmask16 __U, __m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psrlv16si_mask ((__v16si) __X, + (__v16si) __Y, + (__v16si) + _mm512_setzero_si512 (), + (__mmask16) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_srlv_epi64 (__m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psrlv8di_mask ((__v8di) __X, + (__v8di) __Y, + (__v8di) + _mm512_setzero_si512 (), + (__mmask8) -1); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_mask_srlv_epi64 (__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psrlv8di_mask ((__v8di) __X, + (__v8di) __Y, + (__v8di) __W, + (__mmask8) __U); +} + +static __inline__ __m512i __DEFAULT_FN_ATTRS +_mm512_maskz_srlv_epi64 (__mmask8 __U, __m512i __X, __m512i __Y) +{ + return (__m512i) __builtin_ia32_psrlv8di_mask ((__v8di) __X, + (__v8di) __Y, + (__v8di) + _mm512_setzero_si512 (), + (__mmask8) __U); +} + +#define _mm512_ternarylogic_epi32( __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogd512_mask ((__v16si)( __A),\ + (__v16si)( __B),\ + (__v16si)( __C),\ + ( imm), (__mmask16) -1);\ +}) + +#define _mm512_mask_ternarylogic_epi32( __A, __U, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogd512_mask ((__v16si)( __A),\ + (__v16si)( __B),\ + (__v16si)( __C),\ + ( imm), (__mmask16)( __U));\ +}) + +#define _mm512_maskz_ternarylogic_epi32( __U, __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogd512_maskz ((__v16si)( __A),\ + (__v16si)( __B),\ + (__v16si)( __C),\ + ( imm), (__mmask16)( __U));\ +}) + +#define _mm512_maskz_ternarylogic_epi32( __U, __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogd512_maskz ((__v16si)( __A),\ + (__v16si)( __B),\ + (__v16si)( __C),\ + ( imm), (__mmask16)( __U));\ +}) + +#define _mm512_ternarylogic_epi64( __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq512_mask ((__v8di)( __A),\ + (__v8di)( __B),\ + (__v8di)( __C),( imm),\ + (__mmask8) -1);\ +}) + +#define _mm512_mask_ternarylogic_epi64( __A, __U, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq512_mask ((__v8di)( __A),\ + (__v8di)( __B),\ + (__v8di)( __C),( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm512_maskz_ternarylogic_epi64( __U, __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq512_maskz ((__v8di)( __A),\ + (__v8di)( __B),\ + (__v8di)( __C),\ + ( imm), (__mmask8)( __U));\ +}) + +#define _mm512_maskz_ternarylogic_epi64( __U, __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq512_maskz ((__v8di)( __A),\ + (__v8di)( __B),\ + (__v8di)( __C),\ + ( imm), (__mmask8)( __U));\ +}) #undef __DEFAULT_FN_ATTRS Index: lib/Headers/avx512vlintrin.h =================================================================== --- lib/Headers/avx512vlintrin.h +++ lib/Headers/avx512vlintrin.h @@ -6360,6 +6360,141 @@ _mm256_setzero_ps (), (__mmask8) __U); } + +#define _mm_ternarylogic_epi32( __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogd128_mask ((__v4si)( __A),\ + (__v4si)( __B),\ + (__v4si)( __C),( imm),\ + (__mmask8) -1);\ +}) + +#define _mm_mask_ternarylogic_epi32( __A, __U, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogd128_mask ((__v4si)( __A),\ + (__v4si)( __B),\ + (__v4si)( __C),( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm_maskz_ternarylogic_epi32( __U, __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogd128_maskz ((__v4si)( __A),\ + (__v4si)( __B),\ + (__v4si)( __C),\ + ( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm_maskz_ternarylogic_epi32( __U, __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogd128_maskz ((__v4si)( __A),\ + (__v4si)( __B),\ + (__v4si)( __C),\ + ( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm256_ternarylogic_epi32( __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogd256_mask ((__v8si)( __A),\ + (__v8si)( __B),\ + (__v8si)( __C),( imm),\ + (__mmask8) -1);\ +}) + +#define _mm256_mask_ternarylogic_epi32( __A, __U, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogd256_mask ((__v8si)( __A),\ + (__v8si)( __B),\ + (__v8si)( __C),( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm256_maskz_ternarylogic_epi32( __U, __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogd256_maskz ((__v8si)( __A),\ + (__v8si)( __B),\ + (__v8si)( __C),\ + ( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm256_maskz_ternarylogic_epi32( __U, __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogd256_maskz ((__v8si)( __A),\ + (__v8si)( __B),\ + (__v8si)( __C),\ + ( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm_ternarylogic_epi64( __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq128_mask ((__v2di)( __A),\ + (__v2di)( __B),\ + (__v2di)( __C),( imm),\ + (__mmask8) -1);\ +}) + +#define _mm_mask_ternarylogic_epi64( __A, __U, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq128_mask ((__v2di)( __A),\ + (__v2di)( __B),\ + (__v2di)( __C),( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm_maskz_ternarylogic_epi64( __U, __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq128_maskz ((__v2di)( __A),\ + (__v2di)( __B),\ + (__v2di)( __C),\ + ( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm_maskz_ternarylogic_epi64( __U, __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq128_maskz ((__v2di)( __A),\ + (__v2di)( __B),\ + (__v2di)( __C),\ + ( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm256_ternarylogic_epi64( __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq256_mask ((__v4di)( __A),\ + (__v4di)( __B),\ + (__v4di)( __C),( imm),\ + (__mmask8) -1);\ +}) + +#define _mm256_mask_ternarylogic_epi64( __A, __U, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq256_mask ((__v4di)( __A),\ + (__v4di)( __B),\ + (__v4di)( __C),( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm256_maskz_ternarylogic_epi64( __U, __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq256_maskz ((__v4di)( __A),\ + (__v4di)( __B),\ + (__v4di)( __C),\ + ( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm256_ternarylogic_epi64( __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq256_mask ((__v4di)( __A),\ + (__v4di)( __B),\ + (__v4di)( __C),( imm),\ + (__mmask8) -1);\ +}) + +#define _mm256_mask_ternarylogic_epi64( __A, __U, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq256_mask ((__v4di)( __A),\ + (__v4di)( __B),\ + (__v4di)( __C),( imm),\ + (__mmask8)( __U));\ +}) + +#define _mm256_maskz_ternarylogic_epi64( __U, __A, __B, __C, imm) __extension__ ({ \ +__builtin_ia32_pternlogq256_maskz ((__v4di)( __A),\ + (__v4di)( __B),\ + (__v4di)( __C),\ + ( imm),\ + (__mmask8)( __U));\ +}) + #undef __DEFAULT_FN_ATTRS #undef __DEFAULT_FN_ATTRS_BOTH Index: test/CodeGen/avx512f-builtins.c =================================================================== --- test/CodeGen/avx512f-builtins.c +++ test/CodeGen/avx512f-builtins.c @@ -2576,5 +2576,266 @@ return _mm512_kmov(__A); } +__m512i test_mm512_sll_epi32(__m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_sll_epi32 + // CHECK: @llvm.x86.avx512.mask.psll.d + return _mm512_sll_epi32(__A, __B); +} + +__m512i test_mm512_mask_sll_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_mask_sll_epi32 + // CHECK: @llvm.x86.avx512.mask.psll.d + return _mm512_mask_sll_epi32(__W, __U, __A, __B); +} + +__m512i test_mm512_maskz_sll_epi32(__mmask16 __U, __m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_maskz_sll_epi32 + // CHECK: @llvm.x86.avx512.mask.psll.d + return _mm512_maskz_sll_epi32(__U, __A, __B); +} + +__m512i test_mm512_sll_epi64(__m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_sll_epi64 + // CHECK: @llvm.x86.avx512.mask.psll.q + return _mm512_sll_epi64(__A, __B); +} + +__m512i test_mm512_mask_sll_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_mask_sll_epi64 + // CHECK: @llvm.x86.avx512.mask.psll.q + return _mm512_mask_sll_epi64(__W, __U, __A, __B); +} + +__m512i test_mm512_maskz_sll_epi64(__mmask8 __U, __m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_maskz_sll_epi64 + // CHECK: @llvm.x86.avx512.mask.psll.q + return _mm512_maskz_sll_epi64(__U, __A, __B); +} +__m512i test_mm512_sllv_epi32(__m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_sllv_epi32 + // CHECK: @llvm.x86.avx512.mask.psllv.d + return _mm512_sllv_epi32(__X, __Y); +} + +__m512i test_mm512_mask_sllv_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_mask_sllv_epi32 + // CHECK: @llvm.x86.avx512.mask.psllv.d + return _mm512_mask_sllv_epi32(__W, __U, __X, __Y); +} + +__m512i test_mm512_maskz_sllv_epi32(__mmask16 __U, __m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_maskz_sllv_epi32 + // CHECK: @llvm.x86.avx512.mask.psllv.d + return _mm512_maskz_sllv_epi32(__U, __X, __Y); +} + +__m512i test_mm512_sllv_epi64(__m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_sllv_epi64 + // CHECK: @llvm.x86.avx512.mask.psllv.q + return _mm512_sllv_epi64(__X, __Y); +} + +__m512i test_mm512_mask_sllv_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_mask_sllv_epi64 + // CHECK: @llvm.x86.avx512.mask.psllv.q + return _mm512_mask_sllv_epi64(__W, __U, __X, __Y); +} + +__m512i test_mm512_maskz_sllv_epi64(__mmask8 __U, __m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_maskz_sllv_epi64 + // CHECK: @llvm.x86.avx512.mask.psllv.q + return _mm512_maskz_sllv_epi64(__U, __X, __Y); +} +__m512i test_mm512_sra_epi32(__m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_sra_epi32 + // CHECK: @llvm.x86.avx512.mask.psra.d + return _mm512_sra_epi32(__A, __B); +} + +__m512i test_mm512_mask_sra_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_mask_sra_epi32 + // CHECK: @llvm.x86.avx512.mask.psra.d + return _mm512_mask_sra_epi32(__W, __U, __A, __B); +} + +__m512i test_mm512_maskz_sra_epi32(__mmask16 __U, __m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_maskz_sra_epi32 + // CHECK: @llvm.x86.avx512.mask.psra.d + return _mm512_maskz_sra_epi32(__U, __A, __B); +} + +__m512i test_mm512_sra_epi64(__m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_sra_epi64 + // CHECK: @llvm.x86.avx512.mask.psra.q + return _mm512_sra_epi64(__A, __B); +} + +__m512i test_mm512_mask_sra_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_mask_sra_epi64 + // CHECK: @llvm.x86.avx512.mask.psra.q + return _mm512_mask_sra_epi64(__W, __U, __A, __B); +} + +__m512i test_mm512_maskz_sra_epi64(__mmask8 __U, __m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_maskz_sra_epi64 + // CHECK: @llvm.x86.avx512.mask.psra.q + return _mm512_maskz_sra_epi64(__U, __A, __B); +} + +__m512i test_mm512_srav_epi32(__m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_srav_epi32 + // CHECK: @llvm.x86.avx512.mask.psrav.d + return _mm512_srav_epi32(__X, __Y); +} + +__m512i test_mm512_mask_srav_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_mask_srav_epi32 + // CHECK: @llvm.x86.avx512.mask.psrav.d + return _mm512_mask_srav_epi32(__W, __U, __X, __Y); +} + +__m512i test_mm512_maskz_srav_epi32(__mmask16 __U, __m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_maskz_srav_epi32 + // CHECK: @llvm.x86.avx512.mask.psrav.d + return _mm512_maskz_srav_epi32(__U, __X, __Y); +} + +__m512i test_mm512_srav_epi64(__m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_srav_epi64 + // CHECK: @llvm.x86.avx512.mask.psrav.q + return _mm512_srav_epi64(__X, __Y); +} + +__m512i test_mm512_mask_srav_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_mask_srav_epi64 + // CHECK: @llvm.x86.avx512.mask.psrav.q + return _mm512_mask_srav_epi64(__W, __U, __X, __Y); +} + +__m512i test_mm512_maskz_srav_epi64(__mmask8 __U, __m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_maskz_srav_epi64 + // CHECK: @llvm.x86.avx512.mask.psrav.q + return _mm512_maskz_srav_epi64(__U, __X, __Y); +} + +__m512i test_mm512_srl_epi32(__m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_srl_epi32 + // CHECK: @llvm.x86.avx512.mask.psrl.d + return _mm512_srl_epi32(__A, __B); +} + +__m512i test_mm512_mask_srl_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_mask_srl_epi32 + // CHECK: @llvm.x86.avx512.mask.psrl.d + return _mm512_mask_srl_epi32(__W, __U, __A, __B); +} + +__m512i test_mm512_maskz_srl_epi32(__mmask16 __U, __m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_maskz_srl_epi32 + // CHECK: @llvm.x86.avx512.mask.psrl.d + return _mm512_maskz_srl_epi32(__U, __A, __B); +} + +__m512i test_mm512_srl_epi64(__m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_srl_epi64 + // CHECK: @llvm.x86.avx512.mask.psrl.q + return _mm512_srl_epi64(__A, __B); +} + +__m512i test_mm512_mask_srl_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_mask_srl_epi64 + // CHECK: @llvm.x86.avx512.mask.psrl.q + return _mm512_mask_srl_epi64(__W, __U, __A, __B); +} + +__m512i test_mm512_maskz_srl_epi64(__mmask8 __U, __m512i __A, __m128i __B) { + // CHECK-LABEL: @test_mm512_maskz_srl_epi64 + // CHECK: @llvm.x86.avx512.mask.psrl.q + return _mm512_maskz_srl_epi64(__U, __A, __B); +} + +__m512i test_mm512_srlv_epi32(__m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_srlv_epi32 + // CHECK: @llvm.x86.avx512.mask.psrlv.d + return _mm512_srlv_epi32(__X, __Y); +} + +__m512i test_mm512_mask_srlv_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_mask_srlv_epi32 + // CHECK: @llvm.x86.avx512.mask.psrlv.d + return _mm512_mask_srlv_epi32(__W, __U, __X, __Y); +} + +__m512i test_mm512_maskz_srlv_epi32(__mmask16 __U, __m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_maskz_srlv_epi32 + // CHECK: @llvm.x86.avx512.mask.psrlv.d + return _mm512_maskz_srlv_epi32(__U, __X, __Y); +} + +__m512i test_mm512_srlv_epi64(__m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_srlv_epi64 + // CHECK: @llvm.x86.avx512.mask.psrlv.q + return _mm512_srlv_epi64(__X, __Y); +} + +__m512i test_mm512_mask_srlv_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_mask_srlv_epi64 + // CHECK: @llvm.x86.avx512.mask.psrlv.q + return _mm512_mask_srlv_epi64(__W, __U, __X, __Y); +} + +__m512i test_mm512_maskz_srlv_epi64(__mmask8 __U, __m512i __X, __m512i __Y) { + // CHECK-LABEL: @test_mm512_maskz_srlv_epi64 + // CHECK: @llvm.x86.avx512.mask.psrlv.q + return _mm512_maskz_srlv_epi64(__U, __X, __Y); +} + +__m512i test_mm512_ternarylogic_epi32(__m512i __A, __m512i __B, __m512i __C) { + // CHECK-LABEL: @test_mm512_ternarylogic_epi32 + // CHECK: @llvm.x86.avx512.mask.pternlog.d.512 + return _mm512_ternarylogic_epi32(__A, __B, __C, 4); +} + +__m512i test_mm512_mask_ternarylogic_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) { + // CHECK-LABEL: @test_mm512_mask_ternarylogic_epi32 + // CHECK: @llvm.x86.avx512.mask.pternlog.d.512 + return _mm512_mask_ternarylogic_epi32(__A, __U, __B, __C, 4); +} + +__m512i test_mm512_maskz_ternarylogic_epi32(__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) { + // CHECK-LABEL: @test_mm512_maskz_ternarylogic_epi32 + // CHECK: @llvm.x86.avx512.maskz.pternlog.d.512 + return _mm512_maskz_ternarylogic_epi32(__U, __A, __B, __C, 4); +} + +__m512i test_mm512_maskz_ternarylogic_epi32(__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) { + // CHECK-LABEL: @test_mm512_maskz_ternarylogic_epi32 + // CHECK: @llvm.x86.avx512.maskz.pternlog.d.512 + return _mm512_maskz_ternarylogic_epi32(__U, __A, __B, __C, 4); +} + +__m512i test_mm512_ternarylogic_epi64(__m512i __A, __m512i __B, __m512i __C) { + // CHECK-LABEL: @test_mm512_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.mask.pternlog.q.512 + return _mm512_ternarylogic_epi64(__A, __B, __C, 4); +} + +__m512i test_mm512_mask_ternarylogic_epi64(__m512i __A, __mmask8 __U, __m512i __B, __m512i __C) { + // CHECK-LABEL: @test_mm512_mask_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.mask.pternlog.q.512 + return _mm512_mask_ternarylogic_epi64(__A, __U, __B, __C, 4); +} + +__m512i test_mm512_maskz_ternarylogic_epi64(__mmask8 __U, __m512i __A, __m512i __B, __m512i __C) { + // CHECK-LABEL: @test_mm512_maskz_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.maskz.pternlog.q.512 + return _mm512_maskz_ternarylogic_epi64(__U, __A, __B, __C, 4); +} + +__m512i test_mm512_maskz_ternarylogic_epi64(__mmask8 __U, __m512i __A, __m512i __B, __m512i __C) { + // CHECK-LABEL: @test_mm512_maskz_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.maskz.pternlog.q.512 + return _mm512_maskz_ternarylogic_epi64(__U, __A, __B, __C, 4); +} Index: test/CodeGen/avx512vl-builtins.c =================================================================== --- test/CodeGen/avx512vl-builtins.c +++ test/CodeGen/avx512vl-builtins.c @@ -4296,3 +4296,110 @@ return _mm256_maskz_loadu_ps(__U, __P); } +__m128i test_mm_ternarylogic_epi32(__m128i __A, __m128i __B, __m128i __C) { + // CHECK-LABEL: @test_mm_ternarylogic_epi32 + // CHECK: @llvm.x86.avx512.mask.pternlog.d.128 + return _mm_ternarylogic_epi32(__A, __B, __C, 4); +} + +__m128i test_mm_mask_ternarylogic_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) { + // CHECK-LABEL: @test_mm_mask_ternarylogic_epi32 + // CHECK: @llvm.x86.avx512.mask.pternlog.d.128 + return _mm_mask_ternarylogic_epi32(__A, __U, __B, __C, 4); +} + +__m128i test_mm_maskz_ternarylogic_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) { + // CHECK-LABEL: @test_mm_maskz_ternarylogic_epi32 + // CHECK: @llvm.x86.avx512.maskz.pternlog.d.128 + return _mm_maskz_ternarylogic_epi32(__U, __A, __B, __C, 4); +} + +__m128i test_mm_maskz_ternarylogic_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) { + // CHECK-LABEL: @test_mm_maskz_ternarylogic_epi32 + // CHECK: @llvm.x86.avx512.maskz.pternlog.d.128 + return _mm_maskz_ternarylogic_epi32(__U, __A, __B, __C, 4); +} + +__m256i test_mm256_ternarylogic_epi32(__m256i __A, __m256i __B, __m256i __C) { + // CHECK-LABEL: @test_mm256_ternarylogic_epi32 + // CHECK: @llvm.x86.avx512.mask.pternlog.d.256 + return _mm256_ternarylogic_epi32(__A, __B, __C, 4); +} + +__m256i test_mm256_mask_ternarylogic_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) { + // CHECK-LABEL: @test_mm256_mask_ternarylogic_epi32 + // CHECK: @llvm.x86.avx512.mask.pternlog.d.256 + return _mm256_mask_ternarylogic_epi32(__A, __U, __B, __C, 4); +} + +__m256i test_mm256_maskz_ternarylogic_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C) { + // CHECK-LABEL: @test_mm256_maskz_ternarylogic_epi32 + // CHECK: @llvm.x86.avx512.maskz.pternlog.d.256 + return _mm256_maskz_ternarylogic_epi32(__U, __A, __B, __C, 4); +} + +__m256i test_mm256_maskz_ternarylogic_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C) { + // CHECK-LABEL: @test_mm256_maskz_ternarylogic_epi32 + // CHECK: @llvm.x86.avx512.maskz.pternlog.d.256 + return _mm256_maskz_ternarylogic_epi32(__U, __A, __B, __C, 4); +} + +__m128i test_mm_ternarylogic_epi64(__m128i __A, __m128i __B, __m128i __C) { + // CHECK-LABEL: @test_mm_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.mask.pternlog.q.128 + return _mm_ternarylogic_epi64(__A, __B, __C, 4); +} + +__m128i test_mm_mask_ternarylogic_epi64(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) { + // CHECK-LABEL: @test_mm_mask_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.mask.pternlog.q.128 + return _mm_mask_ternarylogic_epi64(__A, __U, __B, __C, 4); +} + +__m128i test_mm_maskz_ternarylogic_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) { + // CHECK-LABEL: @test_mm_maskz_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.maskz.pternlog.q.128 + return _mm_maskz_ternarylogic_epi64(__U, __A, __B, __C, 4); +} + +__m128i test_mm_maskz_ternarylogic_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) { + // CHECK-LABEL: @test_mm_maskz_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.maskz.pternlog.q.128 + return _mm_maskz_ternarylogic_epi64(__U, __A, __B, __C, 4); +} + +__m256i test_mm256_ternarylogic_epi64(__m256i __A, __m256i __B, __m256i __C) { + // CHECK-LABEL: @test_mm256_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.mask.pternlog.q.256 + return _mm256_ternarylogic_epi64(__A, __B, __C, 4); +} + +__m256i test_mm256_mask_ternarylogic_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) { + // CHECK-LABEL: @test_mm256_mask_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.mask.pternlog.q.256 + return _mm256_mask_ternarylogic_epi64(__A, __U, __B, __C, 4); +} + +__m256i test_mm256_maskz_ternarylogic_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C) { + // CHECK-LABEL: @test_mm256_maskz_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.maskz.pternlog.q.256 + return _mm256_maskz_ternarylogic_epi64(__U, __A, __B, __C, 4); +} + +__m256i test_mm256_ternarylogic_epi64(__m256i __A, __m256i __B, __m256i __C) { + // CHECK-LABEL: @test_mm256_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.mask.pternlog.q.256 + return _mm256_ternarylogic_epi64(__A, __B, __C, 4); +} + +__m256i test_mm256_mask_ternarylogic_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) { + // CHECK-LABEL: @test_mm256_mask_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.mask.pternlog.q.256 + return _mm256_mask_ternarylogic_epi64(__A, __U, __B, __C, 4); +} + +__m256i test_mm256_maskz_ternarylogic_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C) { + // CHECK-LABEL: @test_mm256_maskz_ternarylogic_epi64 + // CHECK: @llvm.x86.avx512.maskz.pternlog.q.256 + return _mm256_maskz_ternarylogic_epi64(__U, __A, __B, __C, 4); +}