Index: include/clang/Basic/BuiltinsX86.def =================================================================== --- include/clang/Basic/BuiltinsX86.def +++ include/clang/Basic/BuiltinsX86.def @@ -2248,6 +2248,10 @@ TARGET_BUILTIN(__builtin_ia32_movapd256_mask, "V4dV4dV4dUc","","avx512vl") TARGET_BUILTIN(__builtin_ia32_movaps128_mask, "V4fV4fV4fUc","","avx512vl") TARGET_BUILTIN(__builtin_ia32_movaps256_mask, "V8fV8fV8fUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_compressstoredf512_mask, "vV8d*V8dUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_compressstoredi512_mask, "vV8LLi*V8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_compressstoresf512_mask, "vV16f*V16fUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_compressstoresi512_mask, "vV16i*V16iUs","","avx512f") #undef BUILTIN #undef TARGET_BUILTIN Index: lib/Headers/avx512fintrin.h =================================================================== --- lib/Headers/avx512fintrin.h +++ lib/Headers/avx512fintrin.h @@ -7965,6 +7965,33 @@ (__mmask16) __U); } +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_compressstoreu_pd (void *__P, __mmask8 __U, __m512d __A) +{ + __builtin_ia32_compressstoredf512_mask ((__v8df *) __P, (__v8df) __A, + (__mmask8) __U); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_compressstoreu_epi64 (void *__P, __mmask8 __U, __m512i __A) +{ + __builtin_ia32_compressstoredi512_mask ((__v8di *) __P, (__v8di) __A, + (__mmask8) __U); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_compressstoreu_ps (void *__P, __mmask16 __U, __m512 __A) +{ + __builtin_ia32_compressstoresf512_mask ((__v16sf *) __P, (__v16sf) __A, + (__mmask16) __U); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_compressstoreu_epi32 (void *__P, __mmask16 __U, __m512i __A) +{ + __builtin_ia32_compressstoresi512_mask ((__v16si *) __P, (__v16si) __A, + (__mmask16) __U); +} #undef __DEFAULT_FN_ATTRS Index: test/CodeGen/avx512f-builtins.c =================================================================== --- test/CodeGen/avx512f-builtins.c +++ test/CodeGen/avx512f-builtins.c @@ -5528,3 +5528,27 @@ // CHECK: @llvm.x86.avx512.mask.mova.ps.512 return _mm512_maskz_mov_ps(__U, __A); } + +void test_mm512_mask_compressstoreu_pd(void *__P, __mmask8 __U, __m512d __A) { + // CHECK-LABEL: @test_mm512_mask_compressstoreu_pd + // CHECK: @llvm.x86.avx512.mask.compress.store.pd.512 + return _mm512_mask_compressstoreu_pd(__P, __U, __A); +} + +void test_mm512_mask_compressstoreu_epi64(void *__P, __mmask8 __U, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_compressstoreu_epi64 + // CHECK: @llvm.x86.avx512.mask.compress.store.q.512 + return _mm512_mask_compressstoreu_epi64(__P, __U, __A); +} + +void test_mm512_mask_compressstoreu_ps(void *__P, __mmask16 __U, __m512 __A) { + // CHECK-LABEL: @test_mm512_mask_compressstoreu_ps + // CHECK: @llvm.x86.avx512.mask.compress.store.ps.512 + return _mm512_mask_compressstoreu_ps(__P, __U, __A); +} + +void test_mm512_mask_compressstoreu_epi32(void *__P, __mmask16 __U, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_compressstoreu_epi32 + // CHECK: @llvm.x86.avx512.mask.compress.store.d.512 + return _mm512_mask_compressstoreu_epi32(__P, __U, __A); +}