diff options
author | Craig Topper <craig.topper@intel.com> | 2018-05-21 20:19:17 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-05-21 20:19:17 +0000 |
commit | 770ecb406d462256c279c1075ac4ec7bd835eabb (patch) | |
tree | 999b07009bb0fb99dfec6c544f7ed26e8880f1be /lib/Headers/avx512dqintrin.h | |
parent | d0ed64bcd5021ab20a51c356753301897bdf47c0 (diff) | |
download | clang-770ecb406d462256c279c1075ac4ec7bd835eabb.tar.gz |
[X86] Use __builtin_convertvector to implement some of the packed integer to packed float conversion intrinsics.
I believe this is safe assuming default default FP environment. The conversion might be inexact, but it can never overflow the FP type so this shouldn't be undefined behavior for the uitofp/sitofp instructions.
We already do something similar for scalar conversions.
Differential Revision: https://reviews.llvm.org/D46863
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332882 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Headers/avx512dqintrin.h')
-rw-r--r-- | lib/Headers/avx512dqintrin.h | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/lib/Headers/avx512dqintrin.h b/lib/Headers/avx512dqintrin.h index 2c431d9740..e75c958434 100644 --- a/lib/Headers/avx512dqintrin.h +++ b/lib/Headers/avx512dqintrin.h @@ -361,26 +361,21 @@ _mm512_maskz_cvtps_epu64 (__mmask8 __U, __m256 __A) { static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_cvtepi64_pd (__m512i __A) { - return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, - (__v8df) _mm512_setzero_pd(), - (__mmask8) -1, - _MM_FROUND_CUR_DIRECTION); + return (__m512d)__builtin_convertvector((__v8di)__A, __v8df); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_cvtepi64_pd (__m512d __W, __mmask8 __U, __m512i __A) { - return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, - (__v8df) __W, - (__mmask8) __U, - _MM_FROUND_CUR_DIRECTION); + return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, + (__v8df)_mm512_cvtepi64_pd(__A), + (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi64_pd (__mmask8 __U, __m512i __A) { - return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, - (__v8df) _mm512_setzero_pd(), - (__mmask8) __U, - _MM_FROUND_CUR_DIRECTION); + return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, + (__v8df)_mm512_cvtepi64_pd(__A), + (__v8df)_mm512_setzero_pd()); } #define _mm512_cvt_roundepi64_pd(A, R) __extension__ ({ \ @@ -596,26 +591,21 @@ _mm512_maskz_cvttps_epu64 (__mmask8 __U, __m256 __A) { static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_cvtepu64_pd (__m512i __A) { - return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, - (__v8df) _mm512_setzero_pd(), - (__mmask8) -1, - _MM_FROUND_CUR_DIRECTION); + return (__m512d)__builtin_convertvector((__v8du)__A, __v8df); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_cvtepu64_pd (__m512d __W, __mmask8 __U, __m512i __A) { - return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, - (__v8df) __W, - (__mmask8) __U, - _MM_FROUND_CUR_DIRECTION); + return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, + (__v8df)_mm512_cvtepu64_pd(__A), + (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_cvtepu64_pd (__mmask8 __U, __m512i __A) { - return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, - (__v8df) _mm512_setzero_pd(), - (__mmask8) __U, - _MM_FROUND_CUR_DIRECTION); + return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, + (__v8df)_mm512_cvtepu64_pd(__A), + (__v8df)_mm512_setzero_pd()); } #define _mm512_cvt_roundepu64_pd(A, R) __extension__ ({ \ |