From b87cd1f6059789cb154677d8432045a5ca8e16c1 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sun, 15 Apr 2012 14:03:08 -0400 Subject: [PATCH] mmx: fix _mm_shuffle_pi16 function when compiling without optimization 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index 3b4625c..9fd1a76 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman-mmx.c @@ -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 -- 2.7.4