Index: include/clang/Basic/BuiltinsX86.def =================================================================== --- include/clang/Basic/BuiltinsX86.def +++ include/clang/Basic/BuiltinsX86.def @@ -1962,6 +1962,12 @@ 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_movshdup512_mask, "V16fV16fV16fUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_movsldup512_mask, "V16fV16fV16fUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_movshdup128_mask, "V4fV4fV4fUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_movshdup256_mask, "V8fV8fV8fUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_movsldup128_mask, "V4fV4fV4fUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_movsldup256_mask, "V8fV8fV8fUc","","avx512vl") #undef BUILTIN #undef TARGET_BUILTIN Index: lib/Headers/avx512fintrin.h =================================================================== --- lib/Headers/avx512fintrin.h +++ lib/Headers/avx512fintrin.h @@ -5619,6 +5619,58 @@ __R);\ }) +static __inline__ __m512 __DEFAULT_FN_ATTRS +_mm512_movehdup_ps (__m512 __A) +{ + return (__m512) __builtin_ia32_movshdup512_mask ((__v16sf) __A, + (__v16sf) + _mm512_undefined_ps (), + (__mmask16) -1); +} + +static __inline__ __m512 __DEFAULT_FN_ATTRS +_mm512_mask_movehdup_ps (__m512 __W, __mmask16 __U, __m512 __A) +{ + return (__m512) __builtin_ia32_movshdup512_mask ((__v16sf) __A, + (__v16sf) __W, + (__mmask16) __U); +} + +static __inline__ __m512 __DEFAULT_FN_ATTRS +_mm512_maskz_movehdup_ps (__mmask16 __U, __m512 __A) +{ + return (__m512) __builtin_ia32_movshdup512_mask ((__v16sf) __A, + (__v16sf) + _mm512_setzero_ps (), + (__mmask16) __U); +} + +static __inline__ __m512 __DEFAULT_FN_ATTRS +_mm512_moveldup_ps (__m512 __A) +{ + return (__m512) __builtin_ia32_movsldup512_mask ((__v16sf) __A, + (__v16sf) + _mm512_undefined_ps (), + (__mmask16) -1); +} + +static __inline__ __m512 __DEFAULT_FN_ATTRS +_mm512_mask_moveldup_ps (__m512 __W, __mmask16 __U, __m512 __A) +{ + return (__m512) __builtin_ia32_movsldup512_mask ((__v16sf) __A, + (__v16sf) __W, + (__mmask16) __U); +} + +static __inline__ __m512 __DEFAULT_FN_ATTRS +_mm512_maskz_moveldup_ps (__mmask16 __U, __m512 __A) +{ + return (__m512) __builtin_ia32_movsldup512_mask ((__v16sf) __A, + (__v16sf) + _mm512_setzero_ps (), + (__mmask16) __U); +} + #undef __DEFAULT_FN_ATTRS #endif // __AVX512FINTRIN_H Index: lib/Headers/avx512vlintrin.h =================================================================== --- lib/Headers/avx512vlintrin.h +++ lib/Headers/avx512vlintrin.h @@ -7765,6 +7765,74 @@ (__mmask8) __U); } +static __inline__ __m128 __DEFAULT_FN_ATTRS +_mm_mask_movehdup_ps (__m128 __W, __mmask8 __U, __m128 __A) +{ + return (__m128) __builtin_ia32_movshdup128_mask ((__v4sf) __A, + (__v4sf) __W, + (__mmask8) __U); +} + +static __inline__ __m128 __DEFAULT_FN_ATTRS +_mm_maskz_movehdup_ps (__mmask8 __U, __m128 __A) +{ + return (__m128) __builtin_ia32_movshdup128_mask ((__v4sf) __A, + (__v4sf) + _mm_setzero_ps (), + (__mmask8) __U); +} + +static __inline__ __m256 __DEFAULT_FN_ATTRS +_mm256_mask_movehdup_ps (__m256 __W, __mmask8 __U, __m256 __A) +{ + return (__m256) __builtin_ia32_movshdup256_mask ((__v8sf) __A, + (__v8sf) __W, + (__mmask8) __U); +} + +static __inline__ __m256 __DEFAULT_FN_ATTRS +_mm256_maskz_movehdup_ps (__mmask8 __U, __m256 __A) +{ + return (__m256) __builtin_ia32_movshdup256_mask ((__v8sf) __A, + (__v8sf) + _mm256_setzero_ps (), + (__mmask8) __U); +} + +static __inline__ __m128 __DEFAULT_FN_ATTRS +_mm_mask_moveldup_ps (__m128 __W, __mmask8 __U, __m128 __A) +{ + return (__m128) __builtin_ia32_movsldup128_mask ((__v4sf) __A, + (__v4sf) __W, + (__mmask8) __U); +} + +static __inline__ __m128 __DEFAULT_FN_ATTRS +_mm_maskz_moveldup_ps (__mmask8 __U, __m128 __A) +{ + return (__m128) __builtin_ia32_movsldup128_mask ((__v4sf) __A, + (__v4sf) + _mm_setzero_ps (), + (__mmask8) __U); +} + +static __inline__ __m256 __DEFAULT_FN_ATTRS +_mm256_mask_moveldup_ps (__m256 __W, __mmask8 __U, __m256 __A) +{ + return (__m256) __builtin_ia32_movsldup256_mask ((__v8sf) __A, + (__v8sf) __W, + (__mmask8) __U); +} + +static __inline__ __m256 __DEFAULT_FN_ATTRS +_mm256_maskz_moveldup_ps (__mmask8 __U, __m256 __A) +{ + return (__m256) __builtin_ia32_movsldup256_mask ((__v8sf) __A, + (__v8sf) + _mm256_setzero_ps (), + (__mmask8) __U); +} + #undef __DEFAULT_FN_ATTRS #undef __DEFAULT_FN_ATTRS_BOTH Index: test/CodeGen/avx512f-builtins.c =================================================================== --- test/CodeGen/avx512f-builtins.c +++ test/CodeGen/avx512f-builtins.c @@ -3700,4 +3700,38 @@ return _mm_maskz_sqrt_round_ss(__U,__A,__B,_MM_FROUND_CUR_DIRECTION); } +__m512 test_mm512_movehdup_ps(__m512 __A) { + // CHECK-LABEL: @test_mm512_movehdup_ps + // CHECK: @llvm.x86.avx512.mask.movshdup.512 + return _mm512_movehdup_ps(__A); +} + +__m512 test_mm512_mask_movehdup_ps(__m512 __W, __mmask16 __U, __m512 __A) { + // CHECK-LABEL: @test_mm512_mask_movehdup_ps + // CHECK: @llvm.x86.avx512.mask.movshdup.512 + return _mm512_mask_movehdup_ps(__W, __U, __A); +} + +__m512 test_mm512_maskz_movehdup_ps(__mmask16 __U, __m512 __A) { + // CHECK-LABEL: @test_mm512_maskz_movehdup_ps + // CHECK: @llvm.x86.avx512.mask.movshdup.512 + return _mm512_maskz_movehdup_ps(__U, __A); +} +__m512 test_mm512_moveldup_ps(__m512 __A) { + // CHECK-LABEL: @test_mm512_moveldup_ps + // CHECK: @llvm.x86.avx512.mask.movsldup.512 + return _mm512_moveldup_ps(__A); +} + +__m512 test_mm512_mask_moveldup_ps(__m512 __W, __mmask16 __U, __m512 __A) { + // CHECK-LABEL: @test_mm512_mask_moveldup_ps + // CHECK: @llvm.x86.avx512.mask.movsldup.512 + return _mm512_mask_moveldup_ps(__W, __U, __A); +} + +__m512 test_mm512_maskz_moveldup_ps(__mmask16 __U, __m512 __A) { + // CHECK-LABEL: @test_mm512_maskz_moveldup_ps + // CHECK: @llvm.x86.avx512.mask.movsldup.512 + return _mm512_maskz_moveldup_ps(__U, __A); +} Index: test/CodeGen/avx512vl-builtins.c =================================================================== --- test/CodeGen/avx512vl-builtins.c +++ test/CodeGen/avx512vl-builtins.c @@ -5278,3 +5278,51 @@ // CHECK: @llvm.x86.avx512.rsqrt14.ps.256 return _mm256_maskz_rsqrt14_ps(__U, __A); } + +__m128 test_mm_mask_movehdup_ps(__m128 __W, __mmask8 __U, __m128 __A) { + // CHECK-LABEL: @test_mm_mask_movehdup_ps + // CHECK: @llvm.x86.avx512.mask.movshdup.128 + return _mm_mask_movehdup_ps(__W, __U, __A); +} + +__m128 test_mm_maskz_movehdup_ps(__mmask8 __U, __m128 __A) { + // CHECK-LABEL: @test_mm_maskz_movehdup_ps + // CHECK: @llvm.x86.avx512.mask.movshdup.128 + return _mm_maskz_movehdup_ps(__U, __A); +} + +__m256 test_mm256_mask_movehdup_ps(__m256 __W, __mmask8 __U, __m256 __A) { + // CHECK-LABEL: @test_mm256_mask_movehdup_ps + // CHECK: @llvm.x86.avx512.mask.movshdup.256 + return _mm256_mask_movehdup_ps(__W, __U, __A); +} + +__m256 test_mm256_maskz_movehdup_ps(__mmask8 __U, __m256 __A) { + // CHECK-LABEL: @test_mm256_maskz_movehdup_ps + // CHECK: @llvm.x86.avx512.mask.movshdup.256 + return _mm256_maskz_movehdup_ps(__U, __A); +} + +__m128 test_mm_mask_moveldup_ps(__m128 __W, __mmask8 __U, __m128 __A) { + // CHECK-LABEL: @test_mm_mask_moveldup_ps + // CHECK: @llvm.x86.avx512.mask.movsldup.128 + return _mm_mask_moveldup_ps(__W, __U, __A); +} + +__m128 test_mm_maskz_moveldup_ps(__mmask8 __U, __m128 __A) { + // CHECK-LABEL: @test_mm_maskz_moveldup_ps + // CHECK: @llvm.x86.avx512.mask.movsldup.128 + return _mm_maskz_moveldup_ps(__U, __A); +} + +__m256 test_mm256_mask_moveldup_ps(__m256 __W, __mmask8 __U, __m256 __A) { + // CHECK-LABEL: @test_mm256_mask_moveldup_ps + // CHECK: @llvm.x86.avx512.mask.movsldup.256 + return _mm256_mask_moveldup_ps(__W, __U, __A); +} + +__m256 test_mm256_maskz_moveldup_ps(__mmask8 __U, __m256 __A) { + // CHECK-LABEL: @test_mm256_maskz_moveldup_ps + // CHECK: @llvm.x86.avx512.mask.movsldup.256 + return _mm256_maskz_moveldup_ps(__U, __A); +}