diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 2178126..3a66909 100644 --- a/configure.ac +++ b/configure.ac @@ -347,15 +347,27 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #error "Need GCC >= 3.4 for MMX intrinsics" #endif #include <mmintrin.h> +#include <stdint.h> + +/* Check support for block expressions */ +#define _mm_shuffle_pi16(A, N) \ + ({ \ + __m64 ret; \ + \ + /* Some versions of clang will choke on K */ \ + asm ("pshufw %2, %1, %0\n\t" \ + : "=y" (ret) \ + : "y" (A), "K" ((const int8_t)N) \ + ); \ + \ + ret; \ + }) + int main () { __m64 v = _mm_cvtsi32_si64 (1); __m64 w; - /* Some versions of clang will choke on K */ - asm ("pshufw %2, %1, %0\n\t" - : "=y" (w) - : "y" (v), "K" (5) - ); + w = _mm_shuffle_pi16(v, 5); /* Some versions of clang will choke on this */ asm ("pmulhuw %1, %0\n\t" |