Index: cfe/trunk/include/clang/Basic/BuiltinsX86.def =================================================================== --- cfe/trunk/include/clang/Basic/BuiltinsX86.def +++ cfe/trunk/include/clang/Basic/BuiltinsX86.def @@ -2241,6 +2241,7 @@ TARGET_BUILTIN(__builtin_ia32_expandloadsi512_mask, "V16ivC*V16iUs","","avx512f") TARGET_BUILTIN(__builtin_ia32_expandsf512_mask, "V16fV16fV16fUs","","avx512f") TARGET_BUILTIN(__builtin_ia32_expandsi512_mask, "V16iV16iV16iUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtps2pd512_mask, "V8dV8fV8dUcIi","","avx512f") #undef BUILTIN #undef TARGET_BUILTIN Index: cfe/trunk/lib/Headers/avx512fintrin.h =================================================================== --- cfe/trunk/lib/Headers/avx512fintrin.h +++ cfe/trunk/lib/Headers/avx512fintrin.h @@ -7882,6 +7882,55 @@ (__mmask16) __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: cfe/trunk/test/CodeGen/avx512f-builtins.c =================================================================== --- cfe/trunk/test/CodeGen/avx512f-builtins.c +++ cfe/trunk/test/CodeGen/avx512f-builtins.c @@ -5470,3 +5470,38 @@ // CHECK: @llvm.x86.avx512.mask.expand.d.512 return _mm512_maskz_expand_epi32(__U, __A); } +__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); +}