Hi,

This is a patch to include xmmintrin.h on Visual C++ in pixman-mmx.c as this is where _mm_shuffle_pi16 and _mm_mulhi_pu16 are defined on that compiler, and the definitions of those functions provided in pixman-mmx.c use gcc-specific items which Visual C++ does not like at all. This will ensure pixman will compile on Visual C++ when x86-mmx support is enabled.

With blessings, thank you!
-Fan, Chun-wei
From 04eea0a362674be00daf4e28bf8f6b95b0106fcd Mon Sep 17 00:00:00 2001
From: Chun-wei Fan <[email protected]>
Date: Fri, 9 Mar 2012 15:54:06 +0800
Subject: [PATCH] Just include xmmintrin.h on MSVC as well

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 |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index f9efd73..9d1f6af 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -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
  *
-- 
1.7.7.1.msysgit.0

_______________________________________________
Pixman mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pixman

Reply via email to