[CLANG][AVX512][BUILTIN] movddup{128|256|512}

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

llvm-svn: 262617
This commit is contained in:
Michael Zuckerman 2016-03-03 13:43:05 +00:00
parent 1f95cc097c
commit 0d67e4b5d6
5 changed files with 106 additions and 0 deletions

View File

@ -1716,6 +1716,9 @@ TARGET_BUILTIN(__builtin_ia32_movdquhi128_mask, "V8sV8sV8sUc","","avx512bw,avx51
TARGET_BUILTIN(__builtin_ia32_movdquhi256_mask, "V16sV16sV16sUs","","avx512bw,avx512vl")
TARGET_BUILTIN(__builtin_ia32_movdquqi128_mask, "V16cV16cV16cUs","","avx512bw,avx512vl")
TARGET_BUILTIN(__builtin_ia32_movdquqi256_mask, "V32cV32cV32cUi","","avx512bw,avx512vl")
TARGET_BUILTIN(__builtin_ia32_movddup512_mask, "V8dV8dV8dUc","","avx512f")
TARGET_BUILTIN(__builtin_ia32_movddup128_mask, "V2dV2dV2dUc","","avx512vl")
TARGET_BUILTIN(__builtin_ia32_movddup256_mask, "V4dV4dV4dUc","","avx512vl")
#undef BUILTIN
#undef TARGET_BUILTIN

View File

@ -3668,6 +3668,34 @@ _mm512_mask_store_epi64 (void *__P, __mmask8 __U, __m512i __A)
}
static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_movedup_pd (__m512d __A)
{
return (__m512d) __builtin_ia32_movddup512_mask ((__v8df) __A,
(__v8df)
_mm512_undefined_pd (),
(__mmask8) -1);
}
static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_mask_movedup_pd (__m512d __W, __mmask8 __U, __m512d __A)
{
return (__m512d) __builtin_ia32_movddup512_mask ((__v8df) __A,
(__v8df) __W,
(__mmask8) __U);
}
static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_maskz_movedup_pd (__mmask8 __U, __m512d __A)
{
return (__m512d) __builtin_ia32_movddup512_mask ((__v8df) __A,
(__v8df)
_mm512_setzero_pd (),
(__mmask8) __U);
}
#undef __DEFAULT_FN_ATTRS
#endif // __AVX512FINTRIN_H

View File

@ -5978,6 +5978,39 @@ _mm256_mask_store_epi64 (void *__P, __mmask8 __U, __m256i __A)
(__mmask8) __U);
}
static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_mask_movedup_pd (__m128d __W, __mmask8 __U, __m128d __A)
{
return (__m128d) __builtin_ia32_movddup128_mask ((__v2df) __A,
(__v2df) __W,
(__mmask8) __U);
}
static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_maskz_movedup_pd (__mmask8 __U, __m128d __A)
{
return (__m128d) __builtin_ia32_movddup128_mask ((__v2df) __A,
(__v2df)
_mm_setzero_pd (),
(__mmask8) __U);
}
static __inline__ __m256d __DEFAULT_FN_ATTRS
_mm256_mask_movedup_pd (__m256d __W, __mmask8 __U, __m256d __A)
{
return (__m256d) __builtin_ia32_movddup256_mask ((__v4df) __A,
(__v4df) __W,
(__mmask8) __U);
}
static __inline__ __m256d __DEFAULT_FN_ATTRS
_mm256_maskz_movedup_pd (__mmask8 __U, __m256d __A)
{
return (__m256d) __builtin_ia32_movddup256_mask ((__v4df) __A,
(__v4df)
_mm256_setzero_pd (),
(__mmask8) __U);
}
#undef __DEFAULT_FN_ATTRS
#undef __DEFAULT_FN_ATTRS_BOTH

View File

@ -2346,3 +2346,22 @@ void test_mm512_mask_store_epi64(void *__P, __mmask8 __U, __m512i __A) {
return _mm512_mask_store_epi64(__P, __U, __A);
}
__m512d test_mm512_movedup_pd(__m512d __A) {
// CHECK-LABEL: @test_mm512_movedup_pd
// CHECK: @llvm.x86.avx512.mask.movddup.512
return _mm512_movedup_pd(__A);
}
__m512d test_mm512_mask_movedup_pd(__m512d __W, __mmask8 __U, __m512d __A) {
// CHECK-LABEL: @test_mm512_mask_movedup_pd
// CHECK: @llvm.x86.avx512.mask.movddup.512
return _mm512_mask_movedup_pd(__W, __U, __A);
}
__m512d test_mm512_maskz_movedup_pd(__mmask8 __U, __m512d __A) {
// CHECK-LABEL: @test_mm512_maskz_movedup_pd
// CHECK: @llvm.x86.avx512.mask.movddup.512
return _mm512_maskz_movedup_pd(__U, __A);
}

View File

@ -4008,3 +4008,26 @@ void test_mm256_mask_store_epi64(void *__P, __mmask8 __U, __m256i __A) {
return _mm256_mask_store_epi64(__P, __U, __A);
}
__m128d test_mm_mask_movedup_pd(__m128d __W, __mmask8 __U, __m128d __A) {
// CHECK-LABEL: @test_mm_mask_movedup_pd
// CHECK: @llvm.x86.avx512.mask.movddup.128
return _mm_mask_movedup_pd(__W, __U, __A);
}
__m128d test_mm_maskz_movedup_pd(__mmask8 __U, __m128d __A) {
// CHECK-LABEL: @test_mm_maskz_movedup_pd
// CHECK: @llvm.x86.avx512.mask.movddup.128
return _mm_maskz_movedup_pd(__U, __A);
}
__m256d test_mm256_mask_movedup_pd(__m256d __W, __mmask8 __U, __m256d __A) {
// CHECK-LABEL: @test_mm256_mask_movedup_pd
// CHECK: @llvm.x86.avx512.mask.movddup.256
return _mm256_mask_movedup_pd(__W, __U, __A);
}
__m256d test_mm256_maskz_movedup_pd(__mmask8 __U, __m256d __A) {
// CHECK-LABEL: @test_mm256_maskz_movedup_pd
// CHECK: @llvm.x86.avx512.mask.movddup.256
return _mm256_maskz_movedup_pd(__U, __A);
}