SSE and MMX intrinsics work with Visual Studio now...
authorSam Lantinga <slouken@libsdl.org>
Thu, 16 Aug 2007 06:37:22 +0000
changeset 2251 292bee385630
parent 2250 e1d228456537
child 2252 b80e3d57941f
SSE and MMX intrinsics work with Visual Studio now...
VisualC/SDL/SDL.vcproj
src/video/SDL_blit.h
src/video/SDL_surface.c
--- a/VisualC/SDL/SDL.vcproj	Thu Aug 16 06:20:51 2007 +0000
+++ b/VisualC/SDL/SDL.vcproj	Thu Aug 16 06:37:22 2007 +0000
@@ -47,7 +47,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="..\..\include"
-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400"
+				PreprocessorDefinitions="_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400;__SSE__;__MMX__"
 				RuntimeLibrary="2"
 				BufferSecurityCheck="false"
 				UsePrecompiledHeader="0"
@@ -145,7 +145,7 @@
 				InlineFunctionExpansion="1"
 				EnableIntrinsicFunctions="false"
 				AdditionalIncludeDirectories="..\..\include"
-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0400"
+				PreprocessorDefinitions="NDEBUG;_WINDOWS;_WIN32_WINNT=0x0400;__SSE__;__MMX__"
 				StringPooling="true"
 				RuntimeLibrary="2"
 				BufferSecurityCheck="false"
--- a/src/video/SDL_blit.h	Thu Aug 16 06:20:51 2007 +0000
+++ b/src/video/SDL_blit.h	Thu Aug 16 06:37:22 2007 +0000
@@ -103,7 +103,7 @@
 #if defined(__GNUC__)
 #define DECLARE_ALIGNED(t,v,a)  t __attribute__((aligned(a))) v
 #elif defined(_MSC_VER)
-#define DECLARE_ALIGNED(t,v,a)  t __declspec(align(a)) v
+#define DECLARE_ALIGNED(t,v,a)  __declspec(align(a)) t v
 #else
 #define DECLARE_ALIGNED(t,v,a)  t v
 #endif
--- a/src/video/SDL_surface.c	Thu Aug 16 06:20:51 2007 +0000
+++ b/src/video/SDL_surface.c	Thu Aug 16 06:37:22 2007 +0000
@@ -512,6 +512,14 @@
 #ifdef __SSE__
 /* *INDENT-OFF* */
 
+#ifdef _MSC_VER
+#define SSE_BEGIN \
+    __m128 c128; \
+	c128.m128_u32[0] = color; \
+	c128.m128_u32[1] = color; \
+	c128.m128_u32[2] = color; \
+	c128.m128_u32[3] = color;
+#else
 #define SSE_BEGIN \
     DECLARE_ALIGNED(Uint32, cccc[4], 16); \
     cccc[0] = color; \
@@ -519,6 +527,7 @@
     cccc[2] = color; \
     cccc[3] = color; \
     __m128 c128 = *(__m128 *)cccc;
+#endif
 
 #define SSE_WORK \
     for (i = n / 64; i--;) { \