mmx: fix _mm_shuffle_pi16 function when compiling without optimization
authorMatt Turner <mattst88@gmail.com>
Sun, 15 Apr 2012 18:03:08 +0000 (14:03 -0400)
committerMatt Turner <mattst88@gmail.com>
Sun, 15 Apr 2012 18:03:08 +0000 (14:03 -0400)
The last argument must be an immediate value, and when compiling without
optimization the compiler might not recognize this. So use a macro if
not optimizing.

pixman/pixman-mmx.c

index 3b4625c..9fd1a76 100644 (file)
@@ -73,6 +73,7 @@ _mm_mulhi_pu16 (__m64 __A, __m64 __B)
     return __A;
 }
 
+#  ifdef __OPTIMIZE__
 extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _mm_shuffle_pi16 (__m64 __A, int8_t const __N)
 {
@@ -85,6 +86,10 @@ _mm_shuffle_pi16 (__m64 __A, int8_t const __N)
 
     return ret;
 }
+#  else
+#   define _mm_shuffle_pi16(A, N) \
+    ((__m64) __builtin_ia32_pshufw ((__v4hi)(__m64)(A), (int)(N)))
+#  endif
 # endif
 #endif