summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Basic/BuiltinsX86.def18
-rw-r--r--clang/lib/Headers/avx512bwintrin.h16
-rw-r--r--clang/lib/Headers/avx512vlbwintrin.h32
-rw-r--r--clang/lib/Headers/avx512vlintrin.h97
-rw-r--r--clang/test/CodeGen/avx512bw-builtins.c11
-rw-r--r--clang/test/CodeGen/avx512vl-builtins.c72
-rw-r--r--clang/test/CodeGen/avx512vlbw-builtins.c23
7 files changed, 268 insertions, 1 deletions
diff --git a/clang/include/clang/Basic/BuiltinsX86.def b/clang/include/clang/Basic/BuiltinsX86.def
index f9abd325c75..50eb3227d98 100644
--- a/clang/include/clang/Basic/BuiltinsX86.def
+++ b/clang/include/clang/Basic/BuiltinsX86.def
@@ -1794,6 +1794,24 @@ TARGET_BUILTIN(__builtin_ia32_loadupd128_mask, "V2dV2d*V2dUc","","avx512vl")
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_storedquhi512_mask, "vV32s*V32sUi","","avx512bw")
+TARGET_BUILTIN(__builtin_ia32_storedquqi512_mask, "vV64c*V64cULLi","","avx512bw")
+TARGET_BUILTIN(__builtin_ia32_storedquhi128_mask, "vV8s*V8sUc","","avx512vl,avx512bw")
+TARGET_BUILTIN(__builtin_ia32_storedquhi256_mask, "vV16s*V16sUs","","avx512vl,avx512bw")
+TARGET_BUILTIN(__builtin_ia32_storedquqi128_mask, "vV16c*V16cUs","","avx512vl,avx512bw")
+TARGET_BUILTIN(__builtin_ia32_storedquqi256_mask, "vV32c*V32cUi","","avx512vl,avx512bw")
+TARGET_BUILTIN(__builtin_ia32_storeapd128_mask, "vV2d*V2dUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_storeapd256_mask, "vV4d*V4dUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_storeaps128_mask, "vV4f*V4fUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_storeaps256_mask, "vV8f*V8fUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_storedqudi128_mask, "vV2LLi*V2LLiUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_storedqudi256_mask, "vV4LLi*V4LLiUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_storedqusi128_mask, "vV4i*V4iUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_storedqusi256_mask, "vV8i*V8iUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_storeupd128_mask, "vV2d*V2dUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_storeupd256_mask, "vV4d*V4dUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_storeups128_mask, "vV4f*V4fUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_storeups256_mask, "vV8f*V8fUc","","avx512vl")
#undef BUILTIN
#undef TARGET_BUILTIN
diff --git a/clang/lib/Headers/avx512bwintrin.h b/clang/lib/Headers/avx512bwintrin.h
index f641c71256c..ccd8cce4685 100644
--- a/clang/lib/Headers/avx512bwintrin.h
+++ b/clang/lib/Headers/avx512bwintrin.h
@@ -1981,6 +1981,22 @@ _mm512_maskz_loadu_epi8 (__mmask64 __U, void const *__P)
_mm512_setzero_hi (),
(__mmask64) __U);
}
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm512_mask_storeu_epi16 (void *__P, __mmask32 __U, __m512i __A)
+{
+ __builtin_ia32_storedquhi512_mask ((__v32hi *) __P,
+ (__v32hi) __A,
+ (__mmask32) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm512_mask_storeu_epi8 (void *__P, __mmask64 __U, __m512i __A)
+{
+ __builtin_ia32_storedquqi512_mask ((__v64qi *) __P,
+ (__v64qi) __A,
+ (__mmask64) __U);
+}
+
#undef __DEFAULT_FN_ATTRS
#endif
diff --git a/clang/lib/Headers/avx512vlbwintrin.h b/clang/lib/Headers/avx512vlbwintrin.h
index bb69b1bfdd3..c144fa17ef2 100644
--- a/clang/lib/Headers/avx512vlbwintrin.h
+++ b/clang/lib/Headers/avx512vlbwintrin.h
@@ -3020,6 +3020,38 @@ _mm256_maskz_loadu_epi8 (__mmask32 __U, void const *__P)
_mm256_setzero_si256 (),
(__mmask32) __U);
}
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm_mask_storeu_epi16 (void *__P, __mmask8 __U, __m128i __A)
+{
+ __builtin_ia32_storedquhi128_mask ((__v8hi *) __P,
+ (__v8hi) __A,
+ (__mmask8) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm256_mask_storeu_epi16 (void *__P, __mmask16 __U, __m256i __A)
+{
+ __builtin_ia32_storedquhi256_mask ((__v16hi *) __P,
+ (__v16hi) __A,
+ (__mmask16) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm_mask_storeu_epi8 (void *__P, __mmask16 __U, __m128i __A)
+{
+ __builtin_ia32_storedquqi128_mask ((__v16qi *) __P,
+ (__v16qi) __A,
+ (__mmask16) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm256_mask_storeu_epi8 (void *__P, __mmask32 __U, __m256i __A)
+{
+ __builtin_ia32_storedquqi256_mask ((__v32qi *) __P,
+ (__v32qi) __A,
+ (__mmask32) __U);
+}
+
#undef __DEFAULT_FN_ATTRS
#endif /* __AVX512VLBWINTRIN_H */
diff --git a/clang/lib/Headers/avx512vlintrin.h b/clang/lib/Headers/avx512vlintrin.h
index f09aeb529f6..d99b4d30821 100644
--- a/clang/lib/Headers/avx512vlintrin.h
+++ b/clang/lib/Headers/avx512vlintrin.h
@@ -6360,6 +6360,103 @@ _mm256_maskz_loadu_ps (__mmask8 __U, void const *__P)
_mm256_setzero_ps (),
(__mmask8) __U);
}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm_mask_store_pd (void *__P, __mmask8 __U, __m128d __A)
+{
+ __builtin_ia32_storeapd128_mask ((__v2df *) __P,
+ (__v2df) __A,
+ (__mmask8) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm256_mask_store_pd (void *__P, __mmask8 __U, __m256d __A)
+{
+ __builtin_ia32_storeapd256_mask ((__v4df *) __P,
+ (__v4df) __A,
+ (__mmask8) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm_mask_store_ps (void *__P, __mmask8 __U, __m128 __A)
+{
+ __builtin_ia32_storeaps128_mask ((__v4sf *) __P,
+ (__v4sf) __A,
+ (__mmask8) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm256_mask_store_ps (void *__P, __mmask8 __U, __m256 __A)
+{
+ __builtin_ia32_storeaps256_mask ((__v8sf *) __P,
+ (__v8sf) __A,
+ (__mmask8) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm_mask_storeu_epi64 (void *__P, __mmask8 __U, __m128i __A)
+{
+ __builtin_ia32_storedqudi128_mask ((__v2di *) __P,
+ (__v2di) __A,
+ (__mmask8) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm256_mask_storeu_epi64 (void *__P, __mmask8 __U, __m256i __A)
+{
+ __builtin_ia32_storedqudi256_mask ((__v4di *) __P,
+ (__v4di) __A,
+ (__mmask8) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm_mask_storeu_epi32 (void *__P, __mmask8 __U, __m128i __A)
+{
+ __builtin_ia32_storedqusi128_mask ((__v4si *) __P,
+ (__v4si) __A,
+ (__mmask8) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm256_mask_storeu_epi32 (void *__P, __mmask8 __U, __m256i __A)
+{
+ __builtin_ia32_storedqusi256_mask ((__v8si *) __P,
+ (__v8si) __A,
+ (__mmask8) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm_mask_storeu_pd (void *__P, __mmask8 __U, __m128d __A)
+{
+ __builtin_ia32_storeupd128_mask ((__v2df *) __P,
+ (__v2df) __A,
+ (__mmask8) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm256_mask_storeu_pd (void *__P, __mmask8 __U, __m256d __A)
+{
+ __builtin_ia32_storeupd256_mask ((__v4df *) __P,
+ (__v4df) __A,
+ (__mmask8) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm_mask_storeu_ps (void *__P, __mmask8 __U, __m128 __A)
+{
+ __builtin_ia32_storeups128_mask ((__v4sf *) __P,
+ (__v4sf) __A,
+ (__mmask8) __U);
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+_mm256_mask_storeu_ps (void *__P, __mmask8 __U, __m256 __A)
+{
+ __builtin_ia32_storeups256_mask ((__v8sf *) __P,
+ (__v8sf) __A,
+ (__mmask8) __U);
+}
+
#undef __DEFAULT_FN_ATTRS
#undef __DEFAULT_FN_ATTRS_BOTH
diff --git a/clang/test/CodeGen/avx512bw-builtins.c b/clang/test/CodeGen/avx512bw-builtins.c
index 58a7be913a4..5e39afc6993 100644
--- a/clang/test/CodeGen/avx512bw-builtins.c
+++ b/clang/test/CodeGen/avx512bw-builtins.c
@@ -1346,5 +1346,14 @@ __m512i test_mm512_maskz_loadu_epi8(__mmask64 __U, void const *__P) {
// CHECK: @llvm.x86.avx512.mask.loadu.b.512
return _mm512_maskz_loadu_epi8(__U, __P);
}
+void test_mm512_mask_storeu_epi16(void *__P, __mmask32 __U, __m512i __A) {
+ // CHECK-LABEL: @test_mm512_mask_storeu_epi16
+ // CHECK: @llvm.x86.avx512.mask.storeu.w.
+ return _mm512_mask_storeu_epi16(__P, __U, __A);
+}
-
+void test_mm512_mask_storeu_epi8(void *__P, __mmask64 __U, __m512i __A) {
+ // CHECK-LABEL: @test_mm512_mask_storeu_epi8
+ // CHECK: @llvm.x86.avx512.mask.storeu.b.
+ return _mm512_mask_storeu_epi8(__P, __U, __A);
+}
diff --git a/clang/test/CodeGen/avx512vl-builtins.c b/clang/test/CodeGen/avx512vl-builtins.c
index 95cc5240bc6..e1ab64f2f82 100644
--- a/clang/test/CodeGen/avx512vl-builtins.c
+++ b/clang/test/CodeGen/avx512vl-builtins.c
@@ -4296,3 +4296,75 @@ __m256 test_mm256_maskz_loadu_ps(__mmask8 __U, void const *__P) {
return _mm256_maskz_loadu_ps(__U, __P);
}
+void test_mm_mask_store_pd(void *__P, __mmask8 __U, __m128d __A) {
+ // CHECK-LABEL: @test_mm_mask_store_pd
+ // CHECK: @llvm.x86.avx512.mask.store.pd.128
+ return _mm_mask_store_pd(__P, __U, __A);
+}
+
+void test_mm256_mask_store_pd(void *__P, __mmask8 __U, __m256d __A) {
+ // CHECK-LABEL: @test_mm256_mask_store_pd
+ // CHECK: @llvm.x86.avx512.mask.store.pd.256
+ return _mm256_mask_store_pd(__P, __U, __A);
+}
+
+void test_mm_mask_store_ps(void *__P, __mmask8 __U, __m128 __A) {
+ // CHECK-LABEL: @test_mm_mask_store_ps
+ // CHECK: @llvm.x86.avx512.mask.store.ps.128
+ return _mm_mask_store_ps(__P, __U, __A);
+}
+
+void test_mm256_mask_store_ps(void *__P, __mmask8 __U, __m256 __A) {
+ // CHECK-LABEL: @test_mm256_mask_store_ps
+ // CHECK: @llvm.x86.avx512.mask.store.ps.256
+ return _mm256_mask_store_ps(__P, __U, __A);
+}
+
+void test_mm_mask_storeu_epi64(void *__P, __mmask8 __U, __m128i __A) {
+ // CHECK-LABEL: @test_mm_mask_storeu_epi64
+ // CHECK: @llvm.x86.avx512.mask.storeu
+ return _mm_mask_storeu_epi64(__P, __U, __A);
+}
+
+void test_mm256_mask_storeu_epi64(void *__P, __mmask8 __U, __m256i __A) {
+ // CHECK-LABEL: @test_mm256_mask_storeu_epi64
+ // CHECK: @llvm.x86.avx512.mask.storeu
+ return _mm256_mask_storeu_epi64(__P, __U, __A);
+}
+
+void test_mm_mask_storeu_epi32(void *__P, __mmask8 __U, __m128i __A) {
+ // CHECK-LABEL: @test_mm_mask_storeu_epi32
+ // CHECK: @llvm.x86.avx512.mask.storeu
+ return _mm_mask_storeu_epi32(__P, __U, __A);
+}
+
+void test_mm256_mask_storeu_epi32(void *__P, __mmask8 __U, __m256i __A) {
+ // CHECK-LABEL: @test_mm256_mask_storeu_epi32
+ // CHECK: @llvm.x86.avx512.mask.storeu
+ return _mm256_mask_storeu_epi32(__P, __U, __A);
+}
+
+void test_mm_mask_storeu_pd(void *__P, __mmask8 __U, __m128d __A) {
+ // CHECK-LABEL: @test_mm_mask_storeu_pd
+ // CHECK: @llvm.x86.avx512.mask.storeu.pd.128
+ return _mm_mask_storeu_pd(__P, __U, __A);
+}
+
+void test_mm256_mask_storeu_pd(void *__P, __mmask8 __U, __m256d __A) {
+ // CHECK-LABEL: @test_mm256_mask_storeu_pd
+ // CHECK: @llvm.x86.avx512.mask.storeu.pd.256
+ return _mm256_mask_storeu_pd(__P, __U, __A);
+}
+
+void test_mm_mask_storeu_ps(void *__P, __mmask8 __U, __m128 __A) {
+ // CHECK-LABEL: @test_mm_mask_storeu_ps
+ // CHECK: @llvm.x86.avx512.mask.storeu.ps.128
+ return _mm_mask_storeu_ps(__P, __U, __A);
+}
+
+void test_mm256_mask_storeu_ps(void *__P, __mmask8 __U, __m256 __A) {
+ // CHECK-LABEL: @test_mm256_mask_storeu_ps
+ // CHECK: @llvm.x86.avx512.mask.storeu.ps.256
+ return _mm256_mask_storeu_ps(__P, __U, __A);
+}
+
diff --git a/clang/test/CodeGen/avx512vlbw-builtins.c b/clang/test/CodeGen/avx512vlbw-builtins.c
index 3caa9b340c8..cd7f7a0450d 100644
--- a/clang/test/CodeGen/avx512vlbw-builtins.c
+++ b/clang/test/CodeGen/avx512vlbw-builtins.c
@@ -2053,3 +2053,26 @@ __m256i test_mm256_maskz_loadu_epi8(__mmask32 __U, void const *__P) {
return _mm256_maskz_loadu_epi8(__U, __P);
}
+void test_mm_mask_storeu_epi16(void *__P, __mmask8 __U, __m128i __A) {
+ // CHECK-LABEL: @test_mm_mask_storeu_epi16
+ // CHECK: @llvm.x86.avx512.mask.storeu.w.128
+ return _mm_mask_storeu_epi16(__P, __U, __A);
+}
+
+void test_mm256_mask_storeu_epi16(void *__P, __mmask16 __U, __m256i __A) {
+ // CHECK-LABEL: @test_mm256_mask_storeu_epi16
+ // CHECK: @llvm.x86.avx512.mask.storeu.w.256
+ return _mm256_mask_storeu_epi16(__P, __U, __A);
+}
+
+void test_mm_mask_storeu_epi8(void *__P, __mmask16 __U, __m128i __A) {
+ // CHECK-LABEL: @test_mm_mask_storeu_epi8
+ // CHECK: @llvm.x86.avx512.mask.storeu.b.128
+ return _mm_mask_storeu_epi8(__P, __U, __A);
+}
+
+void test_mm256_mask_storeu_epi8(void *__P, __mmask32 __U, __m256i __A) {
+ // CHECK-LABEL: @test_mm256_mask_storeu_epi8
+ // CHECK: @llvm.x86.avx512.mask.storeu.b.256
+ return _mm256_mask_storeu_epi8(__P, __U, __A);
+}
OpenPOWER on IntegriCloud