# HG changeset patch # User Sam Lantinga # Date 1187246242 0 # Node ID 292bee385630204dafe0dd7e176e155edf2a6cbf # Parent e1d2284565371aab32be99d4d918f4a978e1cdd0 SSE and MMX intrinsics work with Visual Studio now... diff -r e1d228456537 -r 292bee385630 VisualC/SDL/SDL.vcproj --- 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" diff -r e1d228456537 -r 292bee385630 src/video/SDL_blit.h --- 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 diff -r e1d228456537 -r 292bee385630 src/video/SDL_surface.c --- 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--;) { \