Commit 743406ca authored by Sam Lantinga's avatar Sam Lantinga

SSE and MMX intrinsics work with Visual Studio now...

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402613
parent ae461fc3
......@@ -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"
......
......@@ -103,7 +103,7 @@ extern SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface * surface, int complex);
#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
......
......@@ -512,6 +512,14 @@ SDL_UpperBlit(SDL_Surface * src, SDL_Rect * srcrect,
#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 @@ SDL_UpperBlit(SDL_Surface * src, SDL_Rect * srcrect,
cccc[2] = color; \
cccc[3] = color; \
__m128 c128 = *(__m128 *)cccc;
#endif
#define SSE_WORK \
for (i = n / 64; i--;) { \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment