From 81f468c8599a0735d832ae7646128760c5820bc4 Mon Sep 17 00:00:00 2001 From: Michael Zuckerman Date: Mon, 11 Apr 2016 17:04:21 +0000 Subject: [PATCH] [Clang][AVX512][BuiltIn] Adding avx512 ( psll{d|q}512,psllv{16si|8di},psra{d|q}512,psrav{16si|8di},pternlog{d|q}{128|256|512} ) builtin to clang Differential Revision: http://reviews.llvm.org/D18926 llvm-svn: 265964 --- clang/include/clang/Basic/BuiltinsX86.def | 24 ++ clang/lib/Headers/avx512fintrin.h | 390 ++++++++++++++++++++++++++++++ clang/lib/Headers/avx512vlintrin.h | 89 +++++++ clang/test/CodeGen/avx512f-builtins.c | 252 +++++++++++++++++++ clang/test/CodeGen/avx512vl-builtins.c | 74 +++++- 5 files changed, 828 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/Basic/BuiltinsX86.def b/clang/include/clang/Basic/BuiltinsX86.def index 6a666f2..41e2d23 100644 --- a/clang/include/clang/Basic/BuiltinsX86.def +++ b/clang/include/clang/Basic/BuiltinsX86.def @@ -1918,6 +1918,30 @@ TARGET_BUILTIN(__builtin_ia32_psraq128_mask, "V2LLiV2LLiV2LLiV2LLiUc","","avx512 TARGET_BUILTIN(__builtin_ia32_psraq256_mask, "V4LLiV4LLiV2LLiV4LLiUc","","avx512vl") TARGET_BUILTIN(__builtin_ia32_psraqi128_mask, "V2LLiV2LLiIiV2LLiUc","","avx512vl") TARGET_BUILTIN(__builtin_ia32_psraqi256_mask, "V4LLiV4LLiIiV4LLiUc","","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 diff --git a/clang/lib/Headers/avx512fintrin.h b/clang/lib/Headers/avx512fintrin.h index e656e7c..620e096 100644 --- a/clang/lib/Headers/avx512fintrin.h +++ b/clang/lib/Headers/avx512fintrin.h @@ -4005,6 +4005,396 @@ _mm512_unpackhi_epi32 (__m512i __A, __m512i __B) (__mmask16) -1); } +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_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));\ +}) + static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_unpackhi_pd (__mmask8 __U, __m512d __A, __m512d __B) { diff --git a/clang/lib/Headers/avx512vlintrin.h b/clang/lib/Headers/avx512vlintrin.h index fc947d56..acaaae5 100644 --- a/clang/lib/Headers/avx512vlintrin.h +++ b/clang/lib/Headers/avx512vlintrin.h @@ -7407,6 +7407,95 @@ __builtin_ia32_psraqi256_mask ((__v4di)( __A),( __imm),\ (__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 _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 _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 _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 diff --git a/clang/test/CodeGen/avx512f-builtins.c b/clang/test/CodeGen/avx512f-builtins.c index 6f3c4de..2b08ba43 100644 --- a/clang/test/CodeGen/avx512f-builtins.c +++ b/clang/test/CodeGen/avx512f-builtins.c @@ -3287,3 +3287,255 @@ __m512i test_mm512_maskz_srai_epi64(__mmask8 __U, __m512i __A) { // CHECK: @llvm.x86.avx512.mask.psra.qi.512 return _mm512_maskz_srai_epi64(__U, __A, 5); } + +__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_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); +} diff --git a/clang/test/CodeGen/avx512vl-builtins.c b/clang/test/CodeGen/avx512vl-builtins.c index 2566c5d..6eaa803 100644 --- a/clang/test/CodeGen/avx512vl-builtins.c +++ b/clang/test/CodeGen/avx512vl-builtins.c @@ -5014,4 +5014,76 @@ __m256i test_mm256_maskz_srai_epi64(__mmask8 __U, __m256i __A) { // CHECK-LABEL: @test_mm256_maskz_srai_epi64 // CHECK: @llvm.x86.avx512.mask.psra.qi.256 return _mm256_maskz_srai_epi64(__U, __A, 5); -} \ No newline at end of file +} + +__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); +} + +__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); +} + +__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); +} + +__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); +} -- 2.7.4