[Clang][avx512][builtin] Adding intrinsics for vexpand{d|q|ps|pd} instrctuon set

Differential Revision: http://reviews.llvm.org/D19467

llvm-svn: 268214
This commit is contained in:
Michael Zuckerman 2016-05-02 08:36:41 +00:00
parent c62f27e3f4
commit 6a0e0871db
3 changed files with 218 additions and 0 deletions

View File

@ -2233,6 +2233,14 @@ TARGET_BUILTIN(__builtin_ia32_movsldup256_mask, "V8fV8fV8fUc","","avx512vl")
TARGET_BUILTIN(__builtin_ia32_pshufd512_mask, "V16iV16iCsV16iUc","","avx512f")
TARGET_BUILTIN(__builtin_ia32_pshufd256_mask, "V8iV8iCsV8iUc","","avx512vl")
TARGET_BUILTIN(__builtin_ia32_pshufd128_mask, "V4iV4iCsV4iUc","","avx512vl")
TARGET_BUILTIN(__builtin_ia32_expanddf512_mask, "V8dV8dV8dUc","","avx512f")
TARGET_BUILTIN(__builtin_ia32_expanddi512_mask, "V8LLiV8LLiV8LLiUc","","avx512f")
TARGET_BUILTIN(__builtin_ia32_expandloaddf512_mask, "V8dvC*V8dUc","","avx512f")
TARGET_BUILTIN(__builtin_ia32_expandloaddi512_mask, "V8LLivC*V8LLiUc","","avx512f")
TARGET_BUILTIN(__builtin_ia32_expandloadsf512_mask, "V16fvC*V16fUs","","avx512f")
TARGET_BUILTIN(__builtin_ia32_expandloadsi512_mask, "V16ivC*V16iUs","","avx512f")
TARGET_BUILTIN(__builtin_ia32_expandsf512_mask, "V16fV16fV16fUs","","avx512f")
TARGET_BUILTIN(__builtin_ia32_expandsi512_mask, "V16iV16iV16iUs","","avx512f")
#undef BUILTIN
#undef TARGET_BUILTIN

View File

@ -7754,6 +7754,134 @@ __builtin_ia32_pshufd512_mask ((__v16si)( __A),\
(__mmask16)( __U));\
})
static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_mask_expand_pd (__m512d __W, __mmask8 __U, __m512d __A)
{
return (__m512d) __builtin_ia32_expanddf512_mask ((__v8df) __A,
(__v8df) __W,
(__mmask8) __U);
}
static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_maskz_expand_pd (__mmask8 __U, __m512d __A)
{
return (__m512d) __builtin_ia32_expanddf512_mask ((__v8df) __A,
(__v8df) _mm512_setzero_pd (),
(__mmask8) __U);
}
static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_mask_expand_epi64 (__m512i __W, __mmask8 __U, __m512i __A)
{
return (__m512i) __builtin_ia32_expanddi512_mask ((__v8di) __A,
(__v8di) __W,
(__mmask8) __U);
}
static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_maskz_expand_epi64 ( __mmask8 __U, __m512i __A)
{
return (__m512i) __builtin_ia32_expanddi512_mask ((__v8di) __A,
(__v8di) _mm512_setzero_pd (),
(__mmask8) __U);
}
static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_mask_expandloadu_pd(__m512d __W, __mmask8 __U, void const *__P)
{
return (__m512d) __builtin_ia32_expandloaddf512_mask ((const __v8df *)__P,
(__v8df) __W,
(__mmask8) __U);
}
static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_maskz_expandloadu_pd(__mmask8 __U, void const *__P)
{
return (__m512d) __builtin_ia32_expandloaddf512_mask ((const __v8df *)__P,
(__v8df) _mm512_setzero_pd(),
(__mmask8) __U);
}
static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_mask_expandloadu_epi64(__m512i __W, __mmask8 __U, void const *__P)
{
return (__m512i) __builtin_ia32_expandloaddi512_mask ((const __v8di *)__P,
(__v8di) __W,
(__mmask8) __U);
}
static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_maskz_expandloadu_epi64(__mmask8 __U, void const *__P)
{
return (__m512i) __builtin_ia32_expandloaddi512_mask ((const __v8di *)__P,
(__v8di) _mm512_setzero_pd(),
(__mmask8) __U);
}
static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_mask_expandloadu_ps(__m512 __W, __mmask16 __U, void const *__P)
{
return (__m512) __builtin_ia32_expandloadsf512_mask ((const __v16sf *)__P,
(__v16sf) __W,
(__mmask16) __U);
}
static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_maskz_expandloadu_ps(__mmask16 __U, void const *__P)
{
return (__m512) __builtin_ia32_expandloadsf512_mask ((const __v16sf *)__P,
(__v16sf) _mm512_setzero_ps(),
(__mmask16) __U);
}
static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_mask_expandloadu_epi32(__m512i __W, __mmask16 __U, void const *__P)
{
return (__m512i) __builtin_ia32_expandloadsi512_mask ((const __v16si *)__P,
(__v16si) __W,
(__mmask16) __U);
}
static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_maskz_expandloadu_epi32(__mmask16 __U, void const *__P)
{
return (__m512i) __builtin_ia32_expandloadsi512_mask ((const __v16si *)__P,
(__v16si) _mm512_setzero_ps(),
(__mmask16) __U);
}
static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_mask_expand_ps (__m512 __W, __mmask16 __U, __m512 __A)
{
return (__m512) __builtin_ia32_expandsf512_mask ((__v16sf) __A,
(__v16sf) __W,
(__mmask16) __U);
}
static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_maskz_expand_ps (__mmask16 __U, __m512 __A)
{
return (__m512) __builtin_ia32_expandsf512_mask ((__v16sf) __A,
(__v16sf) _mm512_setzero_ps(),
(__mmask16) __U);
}
static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_mask_expand_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
{
return (__m512i) __builtin_ia32_expandsi512_mask ((__v16si) __A,
(__v16si) __W,
(__mmask16) __U);
}
static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_maskz_expand_epi32 (__mmask16 __U, __m512i __A)
{
return (__m512i) __builtin_ia32_expandsi512_mask ((__v16si) __A,
(__v16si) _mm512_setzero_ps(),
(__mmask16) __U);
}
#undef __DEFAULT_FN_ATTRS
#endif // __AVX512FINTRIN_H

View File

@ -5388,3 +5388,85 @@ __m512i test_mm512_maskz_shuffle_epi32(__mmask16 __U, __m512i __A) {
return _mm512_maskz_shuffle_epi32(__U, __A, 1);
}
__m512d test_mm512_mask_expand_pd(__m512d __W, __mmask8 __U, __m512d __A) {
// CHECK-LABEL: @test_mm512_mask_expand_pd
// CHECK: @llvm.x86.avx512.mask.expand.pd.512
return _mm512_mask_expand_pd(__W, __U, __A);
}
__m512d test_mm512_maskz_expand_pd(__mmask8 __U, __m512d __A) {
// CHECK-LABEL: @test_mm512_maskz_expand_pd
// CHECK: @llvm.x86.avx512.mask.expand.pd.512
return _mm512_maskz_expand_pd(__U, __A);
}
__m512i test_mm512_mask_expand_epi64(__m512i __W, __mmask8 __U, __m512i __A) {
// CHECK-LABEL: @test_mm512_mask_expand_epi64
// CHECK: @llvm.x86.avx512.mask.expand.q.512
return _mm512_mask_expand_epi64(__W, __U, __A);
}
__m512i test_mm512_maskz_expand_epi64(__mmask8 __U, __m512i __A) {
// CHECK-LABEL: @test_mm512_maskz_expand_epi64
// CHECK: @llvm.x86.avx512.mask.expand.q.512
return _mm512_maskz_expand_epi64(__U, __A);
}
__m512i test_mm512_mask_expandloadu_epi64(__m512i __W, __mmask8 __U, void const *__P) {
// CHECK-LABEL: @test_mm512_mask_expandloadu_epi64
// CHECK: @llvm.x86.avx512.mask.expand.load.q.512
return _mm512_mask_expandloadu_epi64(__W, __U, __P);
}
__m512i test_mm512_maskz_expandloadu_epi64(__mmask8 __U, void const *__P) {
// CHECK-LABEL: @test_mm512_maskz_expandloadu_epi64
// CHECK: @llvm.x86.avx512.mask.expand.load.q.512
return _mm512_maskz_expandloadu_epi64(__U, __P);
}
__m512d test_mm512_mask_expandloadu_pd(__m512d __W, __mmask8 __U, void const *__P) {
// CHECK-LABEL: @test_mm512_mask_expandloadu_pd
// CHECK: @llvm.x86.avx512.mask.expand.load.pd.512
return _mm512_mask_expandloadu_pd(__W, __U, __P);
}
__m512d test_mm512_maskz_expandloadu_pd(__mmask8 __U, void const *__P) {
// CHECK-LABEL: @test_mm512_maskz_expandloadu_pd
// CHECK: @llvm.x86.avx512.mask.expand.load.pd.512
return _mm512_maskz_expandloadu_pd(__U, __P);
}
__m512i test_mm512_mask_expandloadu_epi32(__m512i __W, __mmask16 __U, void const *__P) {
// CHECK-LABEL: @test_mm512_mask_expandloadu_epi32
// CHECK: @llvm.x86.avx512.mask.expand.load.d.512
return _mm512_mask_expandloadu_epi32(__W, __U, __P);
}
__m512i test_mm512_maskz_expandloadu_epi32(__mmask16 __U, void const *__P) {
// CHECK-LABEL: @test_mm512_maskz_expandloadu_epi32
// CHECK: @llvm.x86.avx512.mask.expand.load.d.512
return _mm512_maskz_expandloadu_epi32(__U, __P);
}
__m512 test_mm512_mask_expand_ps(__m512 __W, __mmask16 __U, __m512 __A) {
// CHECK-LABEL: @test_mm512_mask_expand_ps
// CHECK: @llvm.x86.avx512.mask.expand.ps.512
return _mm512_mask_expand_ps(__W, __U, __A);
}
__m512 test_mm512_maskz_expand_ps(__mmask16 __U, __m512 __A) {
// CHECK-LABEL: @test_mm512_maskz_expand_ps
// CHECK: @llvm.x86.avx512.mask.expand.ps.512
return _mm512_maskz_expand_ps(__U, __A);
}
__m512i test_mm512_mask_expand_epi32(__m512i __W, __mmask16 __U, __m512i __A) {
// CHECK-LABEL: @test_mm512_mask_expand_epi32
// CHECK: @llvm.x86.avx512.mask.expand.d.512
return _mm512_mask_expand_epi32(__W, __U, __A);
}
__m512i test_mm512_maskz_expand_epi32(__mmask16 __U, __m512i __A) {
// CHECK-LABEL: @test_mm512_maskz_expand_epi32
// CHECK: @llvm.x86.avx512.mask.expand.d.512
return _mm512_maskz_expand_epi32(__U, __A);
}