comparison src/video/SDL_yuv_sw.c @ 4045:f420bba13676 SDL-1.2

GCC inline asm for MMX YUV processing no longer has textrels and now works when gcc wants to hog %%ebx for the PIC register. Fixes Bugzilla #418.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 11 Jul 2007 06:26:22 +0000
parents 8a858076f39d
children 940fddb81bea
comparison
equal deleted inserted replaced
4044:009d85e98922 4045:f420bba13676
119 }; 119 };
120 120
121 121
122 /* The colorspace conversion functions */ 122 /* The colorspace conversion functions */
123 123
124 #if 0 /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES*/ 124 #if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
125 extern void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, 125 extern void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
126 unsigned char *lum, unsigned char *cr, 126 unsigned char *lum, unsigned char *cr,
127 unsigned char *cb, unsigned char *out, 127 unsigned char *cb, unsigned char *out,
128 int rows, int cols, int mod ); 128 int rows, int cols, int mod );
129 extern void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, 129 extern void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
1059 /* You have chosen wisely... */ 1059 /* You have chosen wisely... */
1060 switch (format) { 1060 switch (format) {
1061 case SDL_YV12_OVERLAY: 1061 case SDL_YV12_OVERLAY:
1062 case SDL_IYUV_OVERLAY: 1062 case SDL_IYUV_OVERLAY:
1063 if ( display->format->BytesPerPixel == 2 ) { 1063 if ( display->format->BytesPerPixel == 2 ) {
1064 #if 0 /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES*/ 1064 #if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
1065 /* inline assembly functions */ 1065 /* inline assembly functions */
1066 if ( SDL_HasMMX() && (Rmask == 0xF800) && 1066 if ( SDL_HasMMX() && (Rmask == 0xF800) &&
1067 (Gmask == 0x07E0) && 1067 (Gmask == 0x07E0) &&
1068 (Bmask == 0x001F) && 1068 (Bmask == 0x001F) &&
1069 (width & 15) == 0) { 1069 (width & 15) == 0) {
1081 if ( display->format->BytesPerPixel == 3 ) { 1081 if ( display->format->BytesPerPixel == 3 ) {
1082 swdata->Display1X = Color24DitherYV12Mod1X; 1082 swdata->Display1X = Color24DitherYV12Mod1X;
1083 swdata->Display2X = Color24DitherYV12Mod2X; 1083 swdata->Display2X = Color24DitherYV12Mod2X;
1084 } 1084 }
1085 if ( display->format->BytesPerPixel == 4 ) { 1085 if ( display->format->BytesPerPixel == 4 ) {
1086 #if 0 /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES*/ 1086 #if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
1087 /* inline assembly functions */ 1087 /* inline assembly functions */
1088 if ( SDL_HasMMX() && (Rmask == 0x00FF0000) && 1088 if ( SDL_HasMMX() && (Rmask == 0x00FF0000) &&
1089 (Gmask == 0x0000FF00) && 1089 (Gmask == 0x0000FF00) &&
1090 (Bmask == 0x000000FF) && 1090 (Bmask == 0x000000FF) &&
1091 (width & 15) == 0) { 1091 (width & 15) == 0) {