]> granicus.if.org Git - clang/commitdiff
PR7588: Fix the _mm_shufflehi_epi16 macro. (The issue was an oversight
authorEli Friedman <eli.friedman@gmail.com>
Thu, 8 Jul 2010 20:09:45 +0000 (20:09 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 8 Jul 2010 20:09:45 +0000 (20:09 +0000)
involving operator precedence.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107902 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/emmintrin.h

index 8afbe76fbeb5df56cc333206a1c9576316433e2a..f297f36b549cfcdea33e38f177c6f6bc8b69e412 100644 (file)
@@ -1222,9 +1222,10 @@ _mm_movemask_epi8(__m128i a)
                                     4, 5, 6, 7))
 #define _mm_shufflehi_epi16(a, imm) \
   ((__m128i)__builtin_shufflevector((__v8hi)(a), (__v8hi) {0}, 0, 1, 2, 3, \
-                                    4 + ((imm) & 0x3), 4 + ((imm) & 0xc) >> 2, \
-                                    4 + ((imm) & 0x30) >> 4, \
-                                    4 + ((imm) & 0xc0) >> 6))
+                                    4 + (((imm) & 0x03) >> 0), \
+                                    4 + (((imm) & 0x0c) >> 2), \
+                                    4 + (((imm) & 0x30) >> 4), \
+                                    4 + (((imm) & 0xc0) >> 6)))
 
 static __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
 _mm_unpackhi_epi8(__m128i a, __m128i b)