diff src/video/SDL_blit.h @ 2249:5a58b57b6724

Added SSE and MMX optimization for SDL_FillRect()
author Sam Lantinga <slouken@libsdl.org>
date Thu, 16 Aug 2007 05:56:24 +0000
parents 93994f65c74c
children e1d228456537
line wrap: on
line diff
--- a/src/video/SDL_blit.h	Thu Aug 16 02:14:13 2007 +0000
+++ b/src/video/SDL_blit.h	Thu Aug 16 05:56:24 2007 +0000
@@ -24,6 +24,13 @@
 #ifndef _SDL_blit_h
 #define _SDL_blit_h
 
+#ifdef __MMX__
+#include <mmintrin.h>
+#endif
+#ifdef __SSE__
+#include <xmmintrin.h>
+#endif
+
 #include "SDL_endian.h"
 
 /* The structure passed to the low level blit functions */
@@ -92,6 +99,14 @@
  * Useful macros for blitting routines
  */
 
+#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
+#else
+#define DECLARE_ALIGNED(t,v,a)  t v
+#endif
+
 #define FORMAT_EQUAL(A, B)						\
     ((A)->BitsPerPixel == (B)->BitsPerPixel				\
      && ((A)->Rmask == (B)->Rmask) && ((A)->Amask == (B)->Amask))