Just include xmmintrin.h on MSVC as well
authorChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 9 Mar 2012 07:54:06 +0000 (15:54 +0800)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Thu, 15 Mar 2012 19:18:11 +0000 (15:18 -0400)
The xmmintrin.h as shipped with recent Visual C++ (2003+) provides
_mm_shuffle_pi16 and _mm_mulhi_pu16, so including that header
will do for using these functions, and MSVC does not like the GCC-specific
implementations of _mm_shuffle_pi16 and _mm_mulhi_pu16 that is
currently in the code.

_MM_SHUFFLE is declared in the same way in MSVC's xmmintrin.h, so don't
re-define it here to avoid a compilation warning.

pixman/pixman-mmx.c

index f9efd73..9d1f6af 100644 (file)
@@ -57,7 +57,7 @@ _mm_empty (void)
 #endif
 
 #ifdef USE_X86_MMX
-# ifdef __SUNPRO_C
+# if (defined(__SUNPRO_C) || defined(_MSC_VER))
 #  include <xmmintrin.h>
 # else
 /* We have to compile with -msse to use xmmintrin.h, but that causes SSE
@@ -88,8 +88,10 @@ _mm_shuffle_pi16 (__m64 __A, int8_t const __N)
 # endif
 #endif
 
+#ifndef _MSC_VER
 #define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \
  (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0))
+#endif
 
 /* Notes about writing mmx code
  *