r266188 - [Clang][AVX512][Builtin] Adding supporting to intrinsics of cvt{b|d|q}2mask{128|256|512} and cvtmask2{b|d|q}{128|256|512} instruction set.
Michael Zuckerman via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 13 03:49:38 PDT 2016
Author: mzuckerm
Date: Wed Apr 13 05:49:37 2016
New Revision: 266188
URL: http://llvm.org/viewvc/llvm-project?rev=266188&view=rev
Log:
[Clang][AVX512][Builtin] Adding supporting to intrinsics of cvt{b|d|q}2mask{128|256|512} and cvtmask2{b|d|q}{128|256|512} instruction set.
Differential Revision: http://reviews.llvm.org/D19009
Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avx512bwintrin.h
cfe/trunk/lib/Headers/avx512dqintrin.h
cfe/trunk/lib/Headers/avx512vlbwintrin.h
cfe/trunk/lib/Headers/avx512vldqintrin.h
cfe/trunk/test/CodeGen/avx512bw-builtins.c
cfe/trunk/test/CodeGen/avx512dq-builtins.c
cfe/trunk/test/CodeGen/avx512vlbw-builtins.c
cfe/trunk/test/CodeGen/avx512vldq-builtins.c
Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=266188&r1=266187&r2=266188&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Wed Apr 13 05:49:37 2016
@@ -1962,6 +1962,27 @@ TARGET_BUILTIN(__builtin_ia32_rsqrt14pd1
TARGET_BUILTIN(__builtin_ia32_rsqrt14pd256_mask, "V4dV4dV4dUc","","avx512vl")
TARGET_BUILTIN(__builtin_ia32_rsqrt14ps128_mask, "V4fV4fV4fUc","","avx512vl")
TARGET_BUILTIN(__builtin_ia32_rsqrt14ps256_mask, "V8fV8fV8fUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtb2mask512, "ULLiV64c","","avx512bw")
+TARGET_BUILTIN(__builtin_ia32_cvtmask2b512, "V64cULLi","","avx512bw")
+TARGET_BUILTIN(__builtin_ia32_cvtmask2w512, "V32sUi","","avx512bw")
+TARGET_BUILTIN(__builtin_ia32_cvtd2mask512, "UsV16i","","avx512dq")
+TARGET_BUILTIN(__builtin_ia32_cvtmask2d512, "V16iUs","","avx512dq")
+TARGET_BUILTIN(__builtin_ia32_cvtmask2q512, "V8LLiUc","","avx512dq")
+TARGET_BUILTIN(__builtin_ia32_cvtq2mask512, "UcV8LLi","","avx512dq")
+TARGET_BUILTIN(__builtin_ia32_cvtb2mask128, "UsV16c","","avx512bw,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtb2mask256, "UiV32c","","avx512bw,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtmask2b128, "V16cUs","","avx512bw,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtmask2b256, "V32cUi","","avx512bw,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtmask2w128, "V8sUc","","avx512bw,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtmask2w256, "V16sUs","","avx512bw,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtd2mask128, "UcV4i","","avx512dq,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtd2mask256, "UcV8i","","avx512dq,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtmask2d128, "V4iUc","","avx512dq,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtmask2d256, "V8iUc","","avx512dq,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtmask2q128, "V2LLiUc","","avx512dq,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtmask2q256, "V4LLiUc","","avx512dq,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtq2mask128, "UcV2LLi","","avx512dq,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_cvtq2mask256, "UcV4LLi","","avx512dq,avx512vl")
#undef BUILTIN
#undef TARGET_BUILTIN
Modified: cfe/trunk/lib/Headers/avx512bwintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=266188&r1=266187&r2=266188&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512bwintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512bwintrin.h Wed Apr 13 05:49:37 2016
@@ -2057,6 +2057,24 @@ _mm512_mask_testn_epi16_mask (__mmask32
(__v32hi) __B, __U);
}
+static __inline__ __mmask64 __DEFAULT_FN_ATTRS
+_mm512_movepi8_mask (__m512i __A)
+{
+ return (__mmask64) __builtin_ia32_cvtb2mask512 ((__v64qi) __A);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_movm_epi8 (__mmask64 __A)
+{
+ return (__m512i) __builtin_ia32_cvtmask2b512 (__A);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_movm_epi16 (__mmask32 __A)
+{
+ return (__m512i) __builtin_ia32_cvtmask2w512 (__A);
+}
+
#undef __DEFAULT_FN_ATTRS
Modified: cfe/trunk/lib/Headers/avx512dqintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512dqintrin.h?rev=266188&r1=266187&r2=266188&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512dqintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512dqintrin.h Wed Apr 13 05:49:37 2016
@@ -773,6 +773,31 @@ _mm512_maskz_cvtepu64_ps (__mmask8 __U,
(__m512) __builtin_ia32_reduceps512_mask ((__v16sf) __A, __B, \
(__v16sf) _mm512_setzero_ps(), (__mmask16) __U, __R);})
+static __inline__ __mmask16 __DEFAULT_FN_ATTRS
+_mm512_movepi32_mask (__m512i __A)
+{
+ return (__mmask16) __builtin_ia32_cvtd2mask512 ((__v16si) __A);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_movm_epi32 (__mmask16 __A)
+{
+ return (__m512i) __builtin_ia32_cvtmask2d512 (__A);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_movm_epi64 (__mmask8 __A)
+{
+ return (__m512i) __builtin_ia32_cvtmask2q512 (__A);
+}
+
+static __inline__ __mmask8 __DEFAULT_FN_ATTRS
+_mm512_movepi64_mask (__m512i __A)
+{
+ return (__mmask8) __builtin_ia32_cvtq2mask512 ((__v8di) __A);
+}
+
+
#undef __DEFAULT_FN_ATTRS
#endif
Modified: cfe/trunk/lib/Headers/avx512vlbwintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vlbwintrin.h?rev=266188&r1=266187&r2=266188&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512vlbwintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vlbwintrin.h Wed Apr 13 05:49:37 2016
@@ -3172,6 +3172,42 @@ _mm256_mask_testn_epi16_mask (__mmask16
(__v16hi) __B, __U);
}
+static __inline__ __mmask16 __DEFAULT_FN_ATTRS
+_mm_movepi8_mask (__m128i __A)
+{
+ return (__mmask16) __builtin_ia32_cvtb2mask128 ((__v16qi) __A);
+}
+
+static __inline__ __mmask32 __DEFAULT_FN_ATTRS
+_mm256_movepi8_mask (__m256i __A)
+{
+ return (__mmask32) __builtin_ia32_cvtb2mask256 ((__v32qi) __A);
+}
+
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_movm_epi8 (__mmask16 __A)
+{
+ return (__m128i) __builtin_ia32_cvtmask2b128 (__A);
+}
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_movm_epi8 (__mmask32 __A)
+{
+ return (__m256i) __builtin_ia32_cvtmask2b256 (__A);
+}
+
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_movm_epi16 (__mmask8 __A)
+{
+ return (__m128i) __builtin_ia32_cvtmask2w128 (__A);
+}
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_movm_epi16 (__mmask16 __A)
+{
+ return (__m256i) __builtin_ia32_cvtmask2w256 (__A);
+}
+
#undef __DEFAULT_FN_ATTRS
Modified: cfe/trunk/lib/Headers/avx512vldqintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vldqintrin.h?rev=266188&r1=266187&r2=266188&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512vldqintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vldqintrin.h Wed Apr 13 05:49:37 2016
@@ -948,6 +948,54 @@ _mm256_maskz_cvtepu64_ps (__mmask8 __U,
(__m256) __builtin_ia32_reduceps256_mask ((__v8sf) __A, __B, \
(__v8sf) _mm256_setzero_ps(), (__mmask8) __U); })
+static __inline__ __mmask8 __DEFAULT_FN_ATTRS
+_mm_movepi32_mask (__m128i __A)
+{
+ return (__mmask8) __builtin_ia32_cvtd2mask128 ((__v4si) __A);
+}
+
+static __inline__ __mmask8 __DEFAULT_FN_ATTRS
+_mm256_movepi32_mask (__m256i __A)
+{
+ return (__mmask8) __builtin_ia32_cvtd2mask256 ((__v8si) __A);
+}
+
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_movm_epi32 (__mmask8 __A)
+{
+ return (__m128i) __builtin_ia32_cvtmask2d128 (__A);
+}
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_movm_epi32 (__mmask8 __A)
+{
+ return (__m256i) __builtin_ia32_cvtmask2d256 (__A);
+}
+
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_movm_epi64 (__mmask8 __A)
+{
+ return (__m128i) __builtin_ia32_cvtmask2q128 (__A);
+}
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_movm_epi64 (__mmask8 __A)
+{
+ return (__m256i) __builtin_ia32_cvtmask2q256 (__A);
+}
+
+static __inline__ __mmask8 __DEFAULT_FN_ATTRS
+_mm_movepi64_mask (__m128i __A)
+{
+ return (__mmask8) __builtin_ia32_cvtq2mask128 ((__v2di) __A);
+}
+
+static __inline__ __mmask8 __DEFAULT_FN_ATTRS
+_mm256_movepi64_mask (__m256i __A)
+{
+ return (__mmask8) __builtin_ia32_cvtq2mask256 ((__v4di) __A);
+}
+
#undef __DEFAULT_FN_ATTRS
#endif
Modified: cfe/trunk/test/CodeGen/avx512bw-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512bw-builtins.c?rev=266188&r1=266187&r2=266188&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512bw-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512bw-builtins.c Wed Apr 13 05:49:37 2016
@@ -1404,3 +1404,22 @@ __mmask32 test_mm512_mask_testn_epi16_ma
return _mm512_mask_testn_epi16_mask(__U, __A, __B);
}
+__mmask64 test_mm512_movepi8_mask(__m512i __A) {
+ // CHECK-LABEL: @test_mm512_movepi8_mask
+ // CHECK: @llvm.x86.avx512.cvtb2mask.512
+ return _mm512_movepi8_mask(__A);
+}
+
+__m512i test_mm512_movm_epi8(__mmask64 __A) {
+ // CHECK-LABEL: @test_mm512_movm_epi8
+ // CHECK: @llvm.x86.avx512.cvtmask2b.512
+ return _mm512_movm_epi8(__A);
+}
+
+__m512i test_mm512_movm_epi16(__mmask32 __A) {
+ // CHECK-LABEL: @test_mm512_movm_epi16
+ // CHECK: @llvm.x86.avx512.cvtmask2w.512
+ return _mm512_movm_epi16(__A);
+}
+
+
Modified: cfe/trunk/test/CodeGen/avx512dq-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512dq-builtins.c?rev=266188&r1=266187&r2=266188&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512dq-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512dq-builtins.c Wed Apr 13 05:49:37 2016
@@ -743,3 +743,27 @@ __m512 test_mm512_maskz_reduce_round_ps(
return _mm512_maskz_reduce_round_ps(__U, __A, 4, 8);
}
+__mmask16 test_mm512_movepi32_mask(__m512i __A) {
+ // CHECK-LABEL: @test_mm512_movepi32_mask
+ // CHECK: @llvm.x86.avx512.cvtd2mask.512
+ return _mm512_movepi32_mask(__A);
+}
+
+__m512i test_mm512_movm_epi32(__mmask16 __A) {
+ // CHECK-LABEL: @test_mm512_movm_epi32
+ // CHECK: @llvm.x86.avx512.cvtmask2d.512
+ return _mm512_movm_epi32(__A);
+}
+
+__m512i test_mm512_movm_epi64(__mmask8 __A) {
+ // CHECK-LABEL: @test_mm512_movm_epi64
+ // CHECK: @llvm.x86.avx512.cvtmask2q.512
+ return _mm512_movm_epi64(__A);
+}
+
+__mmask8 test_mm512_movepi64_mask(__m512i __A) {
+ // CHECK-LABEL: @test_mm512_movepi64_mask
+ // CHECK: @llvm.x86.avx512.cvtq2mask.512
+ return _mm512_movepi64_mask(__A);
+}
+
Modified: cfe/trunk/test/CodeGen/avx512vlbw-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vlbw-builtins.c?rev=266188&r1=266187&r2=266188&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512vlbw-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512vlbw-builtins.c Wed Apr 13 05:49:37 2016
@@ -2172,3 +2172,41 @@ __mmask16 test_mm256_mask_testn_epi16_ma
return _mm256_mask_testn_epi16_mask(__U, __A, __B);
}
+__mmask16 test_mm_movepi8_mask(__m128i __A) {
+ // CHECK-LABEL: @test_mm_movepi8_mask
+ // CHECK: @llvm.x86.avx512.cvtb2mask.128
+ return _mm_movepi8_mask(__A);
+}
+
+__mmask32 test_mm256_movepi8_mask(__m256i __A) {
+ // CHECK-LABEL: @test_mm256_movepi8_mask
+ // CHECK: @llvm.x86.avx512.cvtb2mask.256
+ return _mm256_movepi8_mask(__A);
+}
+
+__m128i test_mm_movm_epi8(__mmask16 __A) {
+ // CHECK-LABEL: @test_mm_movm_epi8
+ // CHECK: @llvm.x86.avx512.cvtmask2b.128
+ return _mm_movm_epi8(__A);
+}
+
+__m256i test_mm256_movm_epi8(__mmask32 __A) {
+ // CHECK-LABEL: @test_mm256_movm_epi8
+ // CHECK: @llvm.x86.avx512.cvtmask2b.256
+ return _mm256_movm_epi8(__A);
+}
+
+__m128i test_mm_movm_epi16(__mmask8 __A) {
+ // CHECK-LABEL: @test_mm_movm_epi16
+ // CHECK: @llvm.x86.avx512.cvtmask2w.128
+ return _mm_movm_epi16(__A);
+}
+
+__m256i test_mm256_movm_epi16(__mmask16 __A) {
+ // CHECK-LABEL: @test_mm256_movm_epi16
+ // CHECK: @llvm.x86.avx512.cvtmask2w.256
+ return _mm256_movm_epi16(__A);
+}
+
+
+
Modified: cfe/trunk/test/CodeGen/avx512vldq-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vldq-builtins.c?rev=266188&r1=266187&r2=266188&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512vldq-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512vldq-builtins.c Wed Apr 13 05:49:37 2016
@@ -808,3 +808,52 @@ __m256 test_mm256_maskz_reduce_ps(__mmas
// CHECK: @llvm.x86.avx512.mask.reduce.ps.256
return _mm256_maskz_reduce_ps(__U, __A, 4);
}
+
+__mmask8 test_mm_movepi32_mask(__m128i __A) {
+ // CHECK-LABEL: @test_mm_movepi32_mask
+ // CHECK: @llvm.x86.avx512.cvtd2mask.128
+ return _mm_movepi32_mask(__A);
+}
+
+__mmask8 test_mm256_movepi32_mask(__m256i __A) {
+ // CHECK-LABEL: @test_mm256_movepi32_mask
+ // CHECK: @llvm.x86.avx512.cvtd2mask.256
+ return _mm256_movepi32_mask(__A);
+}
+
+__m128i test_mm_movm_epi32(__mmask8 __A) {
+ // CHECK-LABEL: @test_mm_movm_epi32
+ // CHECK: @llvm.x86.avx512.cvtmask2d.128
+ return _mm_movm_epi32(__A);
+}
+
+__m256i test_mm256_movm_epi32(__mmask8 __A) {
+ // CHECK-LABEL: @test_mm256_movm_epi32
+ // CHECK: @llvm.x86.avx512.cvtmask2d.256
+ return _mm256_movm_epi32(__A);
+}
+
+__m128i test_mm_movm_epi64(__mmask8 __A) {
+ // CHECK-LABEL: @test_mm_movm_epi64
+ // CHECK: @llvm.x86.avx512.cvtmask2q.128
+ return _mm_movm_epi64(__A);
+}
+
+__m256i test_mm256_movm_epi64(__mmask8 __A) {
+ // CHECK-LABEL: @test_mm256_movm_epi64
+ // CHECK: @llvm.x86.avx512.cvtmask2q.256
+ return _mm256_movm_epi64(__A);
+}
+
+__mmask8 test_mm_movepi64_mask(__m128i __A) {
+ // CHECK-LABEL: @test_mm_movepi64_mask
+ // CHECK: @llvm.x86.avx512.cvtq2mask.128
+ return _mm_movepi64_mask(__A);
+}
+
+__mmask8 test_mm256_movepi64_mask(__m256i __A) {
+ // CHECK-LABEL: @test_mm256_movepi64_mask
+ // CHECK: @llvm.x86.avx512.cvtq2mask.256
+ return _mm256_movepi64_mask(__A);
+}
+
More information about the cfe-commits
mailing list