Index: lib/Headers/avx512fintrin.h =================================================================== --- lib/Headers/avx512fintrin.h +++ lib/Headers/avx512fintrin.h @@ -2587,19 +2587,46 @@ /* Vector Extract */ #define _mm512_extractf64x4_pd(A, I) __extension__ ({ \ - (__m256d) \ - __builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), \ + (__m256d) __builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), \ (I), \ (__v4df)_mm256_setzero_si256(), \ (__mmask8) -1); }) +#define _mm512_mask_extractf64x4_pd( __W, __U, __A, __imm) __extension__ ({\ + (__m256d) __builtin_ia32_extractf64x4_mask ((__v8df) __A, \ + __imm,\ + (__v4df) __W,\ + (__mmask8) __U);\ +}) + +#define _mm512_maskz_extractf64x4_pd( __U, __A, __imm) __extension__ ({\ + (__m256d) __builtin_ia32_extractf64x4_mask ((__v8df) __A,\ + __imm,\ + (__v4df)\ + _mm256_setzero_pd (),\ + (__mmask8) __U);\ +}) + #define _mm512_extractf32x4_ps(A, I) __extension__ ({ \ - (__m128) \ - __builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), \ + (__m128) __builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), \ (I), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8) -1); }) +#define _mm512_mask_extractf32x4_ps( __W, __U, __A, __imm) __extension__ ({\ + (__m128) __builtin_ia32_extractf32x4_mask ((__v16sf) __A,\ + __imm,\ + (__v4sf) __W,\ + (__mmask8) __U);\ +}) + +#define _mm512_maskz_extractf32x4_ps( __U, __A, __imm) __extension__ ({\ + (__m128) __builtin_ia32_extractf32x4_mask ((__v16sf) __A,\ + __imm,\ + (__v4sf)\ + _mm_setzero_ps (),\ + (__mmask8) __U);\ +}) /* Vector Blend */ static __inline __m512d __DEFAULT_FN_ATTRS Index: test/CodeGen/avx512f-builtins.c =================================================================== --- test/CodeGen/avx512f-builtins.c +++ test/CodeGen/avx512f-builtins.c @@ -842,6 +842,18 @@ return _mm512_extractf64x4_pd(a, 1); } +__m256d test_mm512_mask_extractf64x4_pd(__m256d __W,__mmask8 __U,__m512d __A){ + //CHECK-LABLE:@test_mm512_mask_extractf64x4_pd + //CHECL:@llvm.x86.avx512.mask.vextractf64x4.512 + return _mm512_mask_extractf64x4_pd( __W, __U, __A, 1); +} + +__m256d test_mm512_maskz_extractf64x4_pd(__mmask8 __U,__m512d __A){ + //CHECK-LABLE:@test_mm512_maskz_extractf64x4_pd + //CHECL:@llvm.x86.avx512.mask.vextractf64x4.512 + return _mm512_maskz_extractf64x4_pd( __U, __A, 1); +} + __m128 test_mm512_extractf32x4_ps(__m512 a) { // CHECK-LABEL: @test_mm512_extractf32x4_ps @@ -849,6 +861,18 @@ return _mm512_extractf32x4_ps(a, 1); } +__m128 test_mm512_mask_extractf32x4_ps(__m128 __W, __mmask8 __U,__m512d __A){ + //CHECK-LABLE:@test_mm512_mask_extractf32x4_ps + //CHECL: @llvm.x86.avx512.mask.vextractf32x4.512 + return _mm512_mask_extractf32x4_ps( __W, __U, __A, 1); +} + +__m128 test_mm512_maskz_extractf32x4_ps( __mmask8 __U,__m512d __A){ + //CHECK-LABLE:@test_mm512_maskz_extractf32x4_ps + //CHECL: @llvm.x86.avx512.mask.vextractf32x4.512 + return _mm512_maskz_extractf32x4_ps( __U, __A, 1); +} + __mmask16 test_mm512_cmpeq_epu32_mask(__m512i __a, __m512i __b) { // CHECK-LABEL: @test_mm512_cmpeq_epu32_mask // CHECK: @llvm.x86.avx512.mask.ucmp.d.512(<16 x i32> {{.*}}, <16 x i32> {{.*}}, i32 0, i16 -1)