summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-07-09 06:58:59 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-09-30 17:46:44 -0400
commitd1bd9094ac2208e806cfdf551c6efeb02ff5c7d3 (patch)
treeceb08b56bd7eca0d047317c8ad79c1d697e61545
parentf3412c60333b33075da83fc276b70e4e913bb8f1 (diff)
Make pixman-mmx.c compile on x86-32 without optimization
When not optimizing, write _mm_shuffle_pi16() as a statement expression with inline assembly. That way we avoid __builtin_ia32_pshufw(), which is only available when compiling with -msse, while still allowing the non-optimizing gcc to understand that the second argument is a compile time constant. Tested-by: Knut Petersen <knut_petersen@t-online.de>
-rw-r--r--pixman/pixman-mmx.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 1a014fd..febf95a 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -104,8 +104,17 @@ _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)))
+# define _mm_shuffle_pi16(A, N) \
+ ({ \
+ __m64 ret; \
+ \
+ asm ("pshufw %2, %1, %0\n\t" \
+ : "=y" (ret) \
+ : "y" (A), "K" ((const int8_t)N) \
+ ); \
+ \
+ ret; \
+ })
# endif
# endif
#endif