SSE and MMX intrinsics work with Visual Studio now...
authorSam Lantinga <slouken@libsdl.org>
Thu, 16 Aug 2007 06:37:22 +0000
changeset 2251292bee385630
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
     1.1 --- a/VisualC/SDL/SDL.vcproj	Thu Aug 16 06:20:51 2007 +0000
     1.2 +++ b/VisualC/SDL/SDL.vcproj	Thu Aug 16 06:37:22 2007 +0000
     1.3 @@ -47,7 +47,7 @@
     1.4  				Name="VCCLCompilerTool"
     1.5  				Optimization="0"
     1.6  				AdditionalIncludeDirectories="..\..\include"
     1.7 -				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400"
     1.8 +				PreprocessorDefinitions="_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400;__SSE__;__MMX__"
     1.9  				RuntimeLibrary="2"
    1.10  				BufferSecurityCheck="false"
    1.11  				UsePrecompiledHeader="0"
    1.12 @@ -145,7 +145,7 @@
    1.13  				InlineFunctionExpansion="1"
    1.14  				EnableIntrinsicFunctions="false"
    1.15  				AdditionalIncludeDirectories="..\..\include"
    1.16 -				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0400"
    1.17 +				PreprocessorDefinitions="NDEBUG;_WINDOWS;_WIN32_WINNT=0x0400;__SSE__;__MMX__"
    1.18  				StringPooling="true"
    1.19  				RuntimeLibrary="2"
    1.20  				BufferSecurityCheck="false"
     2.1 --- a/src/video/SDL_blit.h	Thu Aug 16 06:20:51 2007 +0000
     2.2 +++ b/src/video/SDL_blit.h	Thu Aug 16 06:37:22 2007 +0000
     2.3 @@ -103,7 +103,7 @@
     2.4  #if defined(__GNUC__)
     2.5  #define DECLARE_ALIGNED(t,v,a)  t __attribute__((aligned(a))) v
     2.6  #elif defined(_MSC_VER)
     2.7 -#define DECLARE_ALIGNED(t,v,a)  t __declspec(align(a)) v
     2.8 +#define DECLARE_ALIGNED(t,v,a)  __declspec(align(a)) t v
     2.9  #else
    2.10  #define DECLARE_ALIGNED(t,v,a)  t v
    2.11  #endif
     3.1 --- a/src/video/SDL_surface.c	Thu Aug 16 06:20:51 2007 +0000
     3.2 +++ b/src/video/SDL_surface.c	Thu Aug 16 06:37:22 2007 +0000
     3.3 @@ -512,6 +512,14 @@
     3.4  #ifdef __SSE__
     3.5  /* *INDENT-OFF* */
     3.6  
     3.7 +#ifdef _MSC_VER
     3.8 +#define SSE_BEGIN \
     3.9 +    __m128 c128; \
    3.10 +	c128.m128_u32[0] = color; \
    3.11 +	c128.m128_u32[1] = color; \
    3.12 +	c128.m128_u32[2] = color; \
    3.13 +	c128.m128_u32[3] = color;
    3.14 +#else
    3.15  #define SSE_BEGIN \
    3.16      DECLARE_ALIGNED(Uint32, cccc[4], 16); \
    3.17      cccc[0] = color; \
    3.18 @@ -519,6 +527,7 @@
    3.19      cccc[2] = color; \
    3.20      cccc[3] = color; \
    3.21      __m128 c128 = *(__m128 *)cccc;
    3.22 +#endif
    3.23  
    3.24  #define SSE_WORK \
    3.25      for (i = n / 64; i--;) { \