diff options
author | Eric Christopher <echristo@apple.com> | 2010-03-12 01:22:33 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2010-03-12 01:22:33 +0000 |
commit | 6932b2e8b76ff349d034703c7593d2321335cd81 (patch) | |
tree | ae0d955fb425c152389274b993e6dddd894fb9d0 /clang/lib | |
parent | 9caafbc5caa5e6c7ec1877d08c6733b882369a60 (diff) | |
download | bcm5719-llvm-6932b2e8b76ff349d034703c7593d2321335cd81.tar.gz bcm5719-llvm-6932b2e8b76ff349d034703c7593d2321335cd81.zip |
Add SSE4 packed integer comparisons and corresponding intrinsics.
llvm-svn: 98323
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Headers/smmintrin.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/lib/Headers/smmintrin.h b/clang/lib/Headers/smmintrin.h index 29a9c37b45e..7eab8182eb4 100644 --- a/clang/lib/Headers/smmintrin.h +++ b/clang/lib/Headers/smmintrin.h @@ -223,6 +223,29 @@ _mm_max_epu32 (__m128i __V1, __m128i __V2) __a[N];})) #endif /* __x86_64 */ +/* SSE4 128-bit Packed Integer Comparisons. */ +static inline int __attribute__((__always_inline__, __nodebug__)) +_mm_testz_si128(__m128i __M, __m128i __V) +{ + return __builtin_ia32_ptestz128((__v2di)__M, (__v2di)__V); +} + +static inline int __attribute__((__always_inline__, __nodebug__)) +_mm_testc_si128(__m128i __M, __m128i __V) +{ + return __builtin_ia32_ptestc128((__v2di)__M, (__v2di)__V); +} + +static inline int __attribute__((__always_inline__, __nodebug__)) +_mm_testnzc_si128(__m128i __M, __m128i __V) +{ + return __builtin_ia32_ptestnzc128((__v2di)__M, (__v2di)__V); +} + +#define _mm_test_all_ones(V) _mm_testc_si128((V), _mm_cmpeq_epi32((V), (V))) +#define _mm_test_mix_ones_zeros(M, V) _mm_testnzc_si128((M), (V)) +#define _mm_test_all_zeros(M, V) _mm_testz_si128 ((V), (V)) + #endif /* __SSE4_1__ */ #endif /* _SMMINTRIN_H */ |