From 50099cbb48185577df0ad2448bb53501365b6d94 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Mon, 22 Dec 2008 05:20:34 +0000 Subject: [PATCH] Add misc intrinsics git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61327 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Headers/xmmintrin.devel.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/Headers/xmmintrin.devel.h b/lib/Headers/xmmintrin.devel.h index b4f62ff400..ade9b58d83 100644 --- a/lib/Headers/xmmintrin.devel.h +++ b/lib/Headers/xmmintrin.devel.h @@ -624,6 +624,38 @@ static inline void __attribute__((__always_inline__)) _mm_setcsr(unsigned int i) __builtin_ia32_ldmxcsr(i); } +#define _mm_shuffle_ps(a, b, mask) (__builtin_ia32_shufps(a, b, mask)) + +static inline __m128 __attribute__((__always_inline__)) _mm_unpackhi_ps(__m128 a, __m128 b) +{ + return __builtin_shufflevector(a, b, 2, 6, 3, 7); +} + +static inline __m128 __attribute__((__always_inline__)) _mm_unpacklo_ps(__m128 a, __m128 b) +{ + return __builtin_shufflevector(a, b, 0, 4, 1, 5); +} + +static inline __m128 __attribute__((__always_inline__)) _mm_move_ss(__m128 a, __m128 b) +{ + return __builtin_shufflevector(a, b, 4, 1, 2, 3); +} + +static inline __m128 __attribute__((__always_inline__)) _mm_movehl_ps(__m128 a, __m128 b) +{ + return __builtin_shufflevector(a, b, 6, 7, 2, 3); +} + +static inline __m128 __attribute__((__always_inline__)) _mm_movelh_ps(__m128 a, __m128 b) +{ + return __builtin_shufflevector(a, b, 0, 1, 4, 5); +} + +static inline int __attribute__((__always_inline__)) _mm_movemask_ps(__m128 a) +{ + return __builtin_ia32_movmskps(a); +} + #endif /* __SSE__ */ #endif /* __XMMINTRIN_H */ -- 2.40.0