Index: include/clang/Basic/BuiltinsX86.def =================================================================== --- include/clang/Basic/BuiltinsX86.def +++ include/clang/Basic/BuiltinsX86.def @@ -1691,6 +1691,7 @@ TARGET_BUILTIN(__builtin_ia32_psraw256_mask, "V16sV16sV8sV16sUs","","avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_psrawi128_mask, "V8sV8sIiV8sUc","","avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_psrawi256_mask, "V16sV16sIiV16sUs","","avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtps2pd512_mask, "V8dV8fV8dUcIi","","avx512f") #undef BUILTIN #undef TARGET_BUILTIN Index: lib/Headers/avx512fintrin.h =================================================================== --- lib/Headers/avx512fintrin.h +++ lib/Headers/avx512fintrin.h @@ -3602,6 +3602,55 @@ (__mmask8)( __U));\ }) +#define _mm512_cvt_roundps_pd( __A, __R) __extension__ ({ \ +__builtin_ia32_cvtps2pd512_mask ((__v8sf)( __A),\ + (__v8df)\ + _mm512_undefined_pd (),\ + (__mmask8) -1,( __R));\ +}) + +#define _mm512_mask_cvt_roundps_pd( __W, __U, __A, __R) __extension__ ({ \ +__builtin_ia32_cvtps2pd512_mask ((__v8sf)( __A),\ + (__v8df)( __W),\ + (__mmask8)( __U),( __R));\ +}) + +#define _mm512_maskz_cvt_roundps_pd( __U, __A, __R) __extension__ ({ \ +__builtin_ia32_cvtps2pd512_mask ((__v8sf)( __A),\ + (__v8df)\ + _mm512_setzero_pd (),\ + (__mmask8)( __U),( __R));\ +}) + +static __inline__ __m512d __DEFAULT_FN_ATTRS +_mm512_cvtps_pd (__m256 __A) +{ + return (__m512d) __builtin_ia32_cvtps2pd512_mask ((__v8sf) __A, + (__v8df) + _mm512_undefined_pd (), + (__mmask8) -1, + _MM_FROUND_CUR_DIRECTION); +} + +static __inline__ __m512d __DEFAULT_FN_ATTRS +_mm512_mask_cvtps_pd (__m512d __W, __mmask8 __U, __m256 __A) +{ + return (__m512d) __builtin_ia32_cvtps2pd512_mask ((__v8sf) __A, + (__v8df) __W, + (__mmask8) __U, + _MM_FROUND_CUR_DIRECTION); +} + +static __inline__ __m512d __DEFAULT_FN_ATTRS +_mm512_maskz_cvtps_pd (__mmask8 __U, __m256 __A) +{ + return (__m512d) __builtin_ia32_cvtps2pd512_mask ((__v8sf) __A, + (__v8df) + _mm512_setzero_pd (), + (__mmask8) __U, + _MM_FROUND_CUR_DIRECTION); +} + #undef __DEFAULT_FN_ATTRS #endif // __AVX512FINTRIN_H Index: test/CodeGen/avx512f-builtins.c =================================================================== --- test/CodeGen/avx512f-builtins.c +++ test/CodeGen/avx512f-builtins.c @@ -2298,3 +2298,38 @@ return _mm512_maskz_srli_epi64(__U, __A, 5); } +__m512d test_mm512_cvt_roundps_pd(__m256 __A) { + // CHECK-LABEL: @test_mm512_cvt_roundps_pd + // CHECK: @llvm.x86.avx512.mask.cvtps2pd.512 + return _mm512_cvt_roundps_pd(__A, _MM_FROUND_CUR_DIRECTION); +} + +__m512d test_mm512_mask_cvt_roundps_pd(__m512d __W, __mmask8 __U, __m256 __A) { + // CHECK-LABEL: @test_mm512_mask_cvt_roundps_pd + // CHECK: @llvm.x86.avx512.mask.cvtps2pd.512 + return _mm512_mask_cvt_roundps_pd(__W, __U, __A, _MM_FROUND_CUR_DIRECTION); +} + +__m512d test_mm512_maskz_cvt_roundps_pd(__mmask8 __U, __m256 __A) { + // CHECK-LABEL: @test_mm512_maskz_cvt_roundps_pd + // CHECK: @llvm.x86.avx512.mask.cvtps2pd.512 + return _mm512_maskz_cvt_roundps_pd(__U, __A, _MM_FROUND_CUR_DIRECTION); +} + +__m512d test_mm512_cvtps_pd(__m256 __A) { + // CHECK-LABEL: @test_mm512_cvtps_pd + // CHECK: @llvm.x86.avx512.mask.cvtps2pd.512 + return _mm512_cvtps_pd(__A); +} + +__m512d test_mm512_mask_cvtps_pd(__m512d __W, __mmask8 __U, __m256 __A) { + // CHECK-LABEL: @test_mm512_mask_cvtps_pd + // CHECK: @llvm.x86.avx512.mask.cvtps2pd.512 + return _mm512_mask_cvtps_pd(__W, __U, __A); +} + +__m512d test_mm512_maskz_cvtps_pd(__mmask8 __U, __m256 __A) { + // CHECK-LABEL: @test_mm512_maskz_cvtps_pd + // CHECK: @llvm.x86.avx512.mask.cvtps2pd.512 + return _mm512_maskz_cvtps_pd(__U, __A); +}