diff options
author | Adam Nemet <anemet@apple.com> | 2014-07-30 16:51:24 +0000 |
---|---|---|
committer | Adam Nemet <anemet@apple.com> | 2014-07-30 16:51:24 +0000 |
commit | c871ff95f3b2caac6e0b8d73571ba1237479b986 (patch) | |
tree | 5dbe2ce2cd42e7f43470bb51f1374b5a92ba2bea /clang/lib | |
parent | f42e7a274a462fe6940f44313dfc2fedae0d4dc7 (diff) | |
download | bcm5719-llvm-c871ff95f3b2caac6e0b8d73571ba1237479b986.tar.gz bcm5719-llvm-c871ff95f3b2caac6e0b8d73571ba1237479b986.zip |
[AVX512] Add some of the FP cast intrinsics
Part of <rdar://problem/17688758>
llvm-svn: 214315
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Headers/avx512fintrin.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/lib/Headers/avx512fintrin.h b/clang/lib/Headers/avx512fintrin.h index a336f6d7463..2d3a8bba45e 100644 --- a/clang/lib/Headers/avx512fintrin.h +++ b/clang/lib/Headers/avx512fintrin.h @@ -117,6 +117,33 @@ _mm512_set1_epi64(long long __d) return (__m512i)(__v8di){ __d, __d, __d, __d, __d, __d, __d, __d }; } +/* Cast between vector types */ + +static __inline __m512d __attribute__((__always_inline__, __nodebug__)) +_mm512_castpd256_pd512(__m256d __a) +{ + return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, -1, -1, -1, -1); +} + +static __inline __m512 __attribute__((__always_inline__, __nodebug__)) +_mm512_castps256_ps512(__m256 __a) +{ + return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, 4, 5, 6, 7, + -1, -1, -1, -1, -1, -1, -1, -1); +} + +static __inline __m128d __attribute__((__always_inline__, __nodebug__)) +_mm512_castpd512_pd128(__m512d __a) +{ + return __builtin_shufflevector(__a, __a, 0, 1); +} + +static __inline __m128 __attribute__((__always_inline__, __nodebug__)) +_mm512_castps512_ps128(__m512 __a) +{ + return __builtin_shufflevector(__a, __a, 0, 1, 2, 3); +} + /* Arithmetic */ static __inline __m512d __attribute__((__always_inline__, __nodebug__)) |