Skip to content
Permalink
Browse files

Mac OS X/x86 won't build the MMX/YUV inline assembly without optimiza…

…tions

 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.
  • Loading branch information
icculus committed Jul 14, 2007
1 parent b0d1a16 commit 31a58a8e2b05e868680972a36d91a243dadccf44
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/video/SDL_yuv_mmx.c
  2. +3 −3 src/video/SDL_yuv_sw.c
@@ -21,7 +21,7 @@
*/
#include "SDL_config.h"

#if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES

#include "SDL_stdinc.h"

@@ -121,7 +121,7 @@ struct private_yuvhwdata {

/* The colorspace conversion functions */

#if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
extern void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
unsigned char *lum, unsigned char *cr,
unsigned char *cb, unsigned char *out,
@@ -1061,7 +1061,7 @@ SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_S
case SDL_YV12_OVERLAY:
case SDL_IYUV_OVERLAY:
if ( display->format->BytesPerPixel == 2 ) {
#if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
/* inline assembly functions */
if ( SDL_HasMMX() && (Rmask == 0xF800) &&
(Gmask == 0x07E0) &&
@@ -1083,7 +1083,7 @@ SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_S
swdata->Display2X = Color24DitherYV12Mod2X;
}
if ( display->format->BytesPerPixel == 4 ) {
#if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
/* inline assembly functions */
if ( SDL_HasMMX() && (Rmask == 0x00FF0000) &&
(Gmask == 0x0000FF00) &&

0 comments on commit 31a58a8

Please sign in to comment.