Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
SSE and MMX intrinsics work with Visual Studio now...
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 16, 2007
1 parent 5d61a10 commit 88cb5e4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions VisualC/SDL/SDL.vcproj
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/video/SDL_blit.h
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/video/SDL_surface.c
Expand Up @@ -512,13 +512,22 @@ 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; \
cccc[1] = color; \
cccc[2] = color; \
cccc[3] = color; \
__m128 c128 = *(__m128 *)cccc;
#endif

#define SSE_WORK \
for (i = n / 64; i--;) { \
Expand Down

0 comments on commit 88cb5e4

Please sign in to comment.