Merged r3261:3262 from branches/SDL-1.2: MMX/YUV with __OPTIMIZE__.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 14 Jul 2007 07:28:45 +0000
changeset 21972ff40f30af31
parent 2196 2aee80dab68a
child 2198 fe19afb86473
Merged r3261:3262 from branches/SDL-1.2: MMX/YUV with __OPTIMIZE__.

"Mac OS X/x86 won't build the MMX/YUV inline assembly without optimizations
enabled (not enough registers), so for now, we only build it if we see
the __OPTIMIZE__ #define, which GCC provides when you build at -O1 or higher."
src/video/SDL_yuv_mmx.c
src/video/SDL_yuv_sw.c
     1.1 --- a/src/video/SDL_yuv_mmx.c	Sat Jul 14 07:05:19 2007 +0000
     1.2 +++ b/src/video/SDL_yuv_mmx.c	Sat Jul 14 07:28:45 2007 +0000
     1.3 @@ -21,7 +21,7 @@
     1.4  */
     1.5  #include "SDL_config.h"
     1.6  
     1.7 -#if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
     1.8 +#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
     1.9  
    1.10  #include "SDL_stdinc.h"
    1.11  
     2.1 --- a/src/video/SDL_yuv_sw.c	Sat Jul 14 07:05:19 2007 +0000
     2.2 +++ b/src/video/SDL_yuv_sw.c	Sat Jul 14 07:28:45 2007 +0000
     2.3 @@ -117,7 +117,7 @@
     2.4  
     2.5  /* The colorspace conversion functions */
     2.6  
     2.7 -#if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
     2.8 +#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
     2.9  extern void Color565DitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
    2.10                                      unsigned char *lum, unsigned char *cr,
    2.11                                      unsigned char *cb, unsigned char *out,
    2.12 @@ -978,7 +978,7 @@
    2.13      case SDL_PIXELFORMAT_YV12:
    2.14      case SDL_PIXELFORMAT_IYUV:
    2.15          if (SDL_BYTESPERPIXEL(target_format) == 2) {
    2.16 -#if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
    2.17 +#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
    2.18              /* inline assembly functions */
    2.19              if (SDL_HasMMX() && (Rmask == 0xF800) &&
    2.20                  (Gmask == 0x07E0) && (Bmask == 0x001F)
    2.21 @@ -999,7 +999,7 @@
    2.22              swdata->Display2X = Color24DitherYV12Mod2X;
    2.23          }
    2.24          if (SDL_BYTESPERPIXEL(target_format) == 4) {
    2.25 -#if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
    2.26 +#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
    2.27              /* inline assembly functions */
    2.28              if (SDL_HasMMX() && (Rmask == 0x00FF0000) &&
    2.29                  (Gmask == 0x0000FF00) &&