Index: include/clang/Basic/BuiltinsX86.def =================================================================== --- include/clang/Basic/BuiltinsX86.def +++ include/clang/Basic/BuiltinsX86.def @@ -1749,6 +1749,10 @@ TARGET_BUILTIN(__builtin_ia32_vpermt2varqi256_maskz, "V32cV32cV32cV32cUi","","avx512vbmi,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcomisd, "iV2dV2dIiIi","","avx512f") TARGET_BUILTIN(__builtin_ia32_vcomiss, "iV4fV4fIiIi","","avx512f") +TARGET_BUILTIN(__builtin_ia32_storeapd128_mask, "vV2d*V2dUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_storeapd256_mask, "vV4d*V4dUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_storeaps128_mask, "vV4f*V4fUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_storeaps256_mask, "vV8f*V8fUc","","avx512f") #undef BUILTIN #undef TARGET_BUILTIN Index: lib/Headers/avx512vlintrin.h =================================================================== --- lib/Headers/avx512vlintrin.h +++ lib/Headers/avx512vlintrin.h @@ -6068,6 +6068,40 @@ _mm256_setzero_si256 (), __M); } + +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); +} + + #undef __DEFAULT_FN_ATTRS #undef __DEFAULT_FN_ATTRS_BOTH Index: test/CodeGen/avx512vl-builtins.c =================================================================== --- test/CodeGen/avx512vl-builtins.c +++ test/CodeGen/avx512vl-builtins.c @@ -4080,3 +4080,27 @@ return _mm256_maskz_set1_epi64(__M, __A); } +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); +} +