summaryrefslogtreecommitdiff
path: root/pixman/pixman-mmx.c
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2015-10-11 09:45:57 +0200
committerMatt Turner <mattst88@gmail.com>2015-11-18 14:19:58 -0800
commitd24b415f3e2753a588759d028b811e1ce38fea6c (patch)
tree3d9ebc068aeae2a766d99c01e59d24816c3a7123 /pixman/pixman-mmx.c
parent312e381523662aacc2f0ea90eb9ae0634ac5b327 (diff)
mmx: Improve detection of support for "K" constraint
Older versions of clang emitted an error on the "K" constraint, but at least since version 3.7 it is supported. Just like gcc, this constraint is only allowed for constants, but apparently clang requires them to be known before inlining. Using the macro definition _mm_shuffle_pi16(A, N) ensures that the "K" constraint is always applied to a literal constant, independently from the compiler optimizations and allows building pixman-mmx on modern clang. Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Andrea Canciani <ranma42@gmail.com>
Diffstat (limited to 'pixman/pixman-mmx.c')
-rw-r--r--pixman/pixman-mmx.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 05c48a4..dec3974 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -89,21 +89,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)
-{
- __m64 ret;
-
- asm ("pshufw %2, %1, %0\n\t"
- : "=y" (ret)
- : "y" (__A), "K" (__N)
- );
-
- return ret;
-}
-# else
-# define _mm_shuffle_pi16(A, N) \
+# define _mm_shuffle_pi16(A, N) \
({ \
__m64 ret; \
\
@@ -114,7 +100,6 @@ _mm_shuffle_pi16 (__m64 __A, int8_t const __N)
\
ret; \
})
-# endif
# endif
#endif