[X86] Use __builtin_convertvector to implement _mm512_cvtps_pd.

If we're using default rounding mode we can let __builtin_convertvector to generate an fpextend. This matches 128 and 256 bit.

If we're using the version that takes an explicit rounding mode argument we would need to look at the immediate to see if its CUR_DIRECTION.

llvm-svn: 332210
This commit is contained in:
Craig Topper 2018-05-14 04:05:06 +00:00
parent 845fe8a708
commit daaf105f86
2 changed files with 3 additions and 7 deletions

View File

@ -9311,11 +9311,7 @@ _mm512_maskz_expand_epi32 (__mmask16 __U, __m512i __A)
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);
return (__m512d) __builtin_convertvector((__v8sf)__A, __v8df);
}
static __inline__ __m512d __DEFAULT_FN_ATTRS

View File

@ -6630,14 +6630,14 @@ __m512d test_mm512_maskz_cvt_roundps_pd(__mmask8 __U, __m256 __A) {
__m512d test_mm512_cvtps_pd(__m256 __A) {
// CHECK-LABEL: @test_mm512_cvtps_pd
// CHECK: @llvm.x86.avx512.mask.cvtps2pd.512
// CHECK: fpext <8 x float> %{{.*}} to <8 x double>
return _mm512_cvtps_pd(__A);
}
__m512d test_mm512_cvtpslo_pd(__m512 __A) {
// CHECK-LABEL: @test_mm512_cvtpslo_pd
// CHECK: shufflevector <16 x float> %{{.*}}, <16 x float> %{{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
// CHECK: @llvm.x86.avx512.mask.cvtps2pd.512
// CHECK: fpext <8 x float> %{{.*}} to <8 x double>
return _mm512_cvtpslo_pd(__A);
}