[cfe-commits] r115423 - in /cfe/trunk: include/clang/Basic/BuiltinsX86.def lib/Headers/xmmintrin.h

Chris Lattner sabre at nondot.org
Sat Oct 2 14:32:59 PDT 2010


Author: lattner
Date: Sat Oct  2 16:32:59 2010
New Revision: 115423

URL: http://llvm.org/viewvc/llvm-project?rev=115423&view=rev
Log:
the mmx intrinsic for pshufw should map to the IR intrinsic, not
to a shufflevector.  Otherwise it doesn't turn into a pshufw.
This bug was introduced in the mmx rewrite.

Modified:
    cfe/trunk/include/clang/Basic/BuiltinsX86.def
    cfe/trunk/lib/Headers/xmmintrin.h

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=115423&r1=115422&r2=115423&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sat Oct  2 16:32:59 2010
@@ -82,6 +82,7 @@
 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", "")

Modified: cfe/trunk/lib/Headers/xmmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/xmmintrin.h?rev=115423&r1=115422&r2=115423&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/xmmintrin.h (original)
+++ cfe/trunk/lib/Headers/xmmintrin.h Sat Oct  2 16:32:59 2010
@@ -712,9 +712,7 @@
 }
 
 #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)





More information about the cfe-commits mailing list