]> granicus.if.org Git - clang/commitdiff
the mmx intrinsic for pshufw should map to the IR intrinsic, not
authorChris Lattner <sabre@nondot.org>
Sat, 2 Oct 2010 21:32:59 +0000 (21:32 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 2 Oct 2010 21:32:59 +0000 (21:32 +0000)
to a shufflevector.  Otherwise it doesn't turn into a pshufw.
This bug was introduced in the mmx rewrite.

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

include/clang/Basic/BuiltinsX86.def
lib/Headers/xmmintrin.h

index 8a730a836b6ff4c6cb958325d850fc584de0cbfb..cb14f5015e9542e16ddb1bfcd84bdde569613fcf 100644 (file)
@@ -82,6 +82,7 @@ BUILTIN(__builtin_ia32_psradi, "V2iV2ii", "")
 BUILTIN(__builtin_ia32_packsswb, "V8cV4sV4s", "")
 BUILTIN(__builtin_ia32_packssdw, "V4sV2iV2i", "")
 BUILTIN(__builtin_ia32_packuswb, "V8cV4sV4s", "")
+BUILTIN(__builtin_ia32_pshufw, "V4sV4sIi", "")
 BUILTIN(__builtin_ia32_punpckhbw, "V8cV8cV8c", "")
 BUILTIN(__builtin_ia32_punpckhwd, "V4sV4sV4s", "")
 BUILTIN(__builtin_ia32_punpckhdq, "V2iV2iV2i", "")
index 8363b4594b1f49b4451d5ec51dd9fa41e35dd22c..6f270f8e0829282c602510266ff9e8b18fd3241d 100644 (file)
@@ -712,9 +712,7 @@ _mm_mulhi_pu16(__m64 a, __m64 b)
 }
 
 #define _mm_shuffle_pi16(a, n) \
-  ((__m64)__builtin_shufflevector((__v4hi)(a), (__v4hi) {0}, \
-                                  (n) & 0x3, ((n) & 0xc) >> 2, \
-                                  ((n) & 0x30) >> 4, ((n) & 0xc0) >> 6))
+  ((__m64)__builtin_ia32_pshufw(a, n))
 
 static __inline__ void __attribute__((__always_inline__, __nodebug__))
 _mm_maskmove_si64(__m64 d, __m64 n, char *p)