src/video/SDL_yuv_mmx.c
changeset 946 8520712f8ef0
parent 887 b4b64bb88f2f
child 949 e0d96eb0af19
     1.1 --- a/src/video/SDL_yuv_mmx.c	Sat Aug 21 13:49:22 2004 +0000
     1.2 +++ b/src/video/SDL_yuv_mmx.c	Sat Aug 21 14:54:49 2004 +0000
     1.3 @@ -30,35 +30,29 @@
     1.4  
     1.5  #include "SDL_types.h"
     1.6  
     1.7 -#ifdef __ELF__
     1.8 -#define ASM_VAR(X) _##X
     1.9 -#else
    1.10 -#define ASM_VAR(X) X
    1.11 -#endif
    1.12 +static unsigned int  MMX_0080w[]    = {0x00800080, 0x00800080};
    1.13 +static unsigned int  MMX_00FFw[]    = {0x00ff00ff, 0x00ff00ff}; 
    1.14 +static unsigned int  MMX_FF00w[]    = {0xff00ff00, 0xff00ff00}; 
    1.15  
    1.16 -static unsigned int  ASM_VAR(MMX_0080w)[]    = {0x00800080, 0x00800080};
    1.17 -static unsigned int  ASM_VAR(MMX_00FFw)[]    = {0x00ff00ff, 0x00ff00ff}; 
    1.18 -static unsigned int  ASM_VAR(MMX_FF00w)[]    = {0xff00ff00, 0xff00ff00}; 
    1.19 +static unsigned short MMX_Ycoeff[]  = {0x004a, 0x004a, 0x004a, 0x004a}; 
    1.20  
    1.21 -static unsigned short ASM_VAR(MMX_Ycoeff)[]  = {0x004a, 0x004a, 0x004a, 0x004a}; 
    1.22 +static unsigned short MMX_UbluRGB[] = {0x0072, 0x0072, 0x0072, 0x0072};    
    1.23 +static unsigned short MMX_VredRGB[] = {0x0059, 0x0059, 0x0059, 0x0059};  
    1.24 +static unsigned short MMX_UgrnRGB[] = {0xffea, 0xffea, 0xffea, 0xffea}; 
    1.25 +static unsigned short MMX_VgrnRGB[] = {0xffd2, 0xffd2, 0xffd2, 0xffd2};  
    1.26  
    1.27 -static unsigned short ASM_VAR(MMX_UbluRGB)[] = {0x0072, 0x0072, 0x0072, 0x0072};    
    1.28 -static unsigned short ASM_VAR(MMX_VredRGB)[] = {0x0059, 0x0059, 0x0059, 0x0059};  
    1.29 -static unsigned short ASM_VAR(MMX_UgrnRGB)[] = {0xffea, 0xffea, 0xffea, 0xffea}; 
    1.30 -static unsigned short ASM_VAR(MMX_VgrnRGB)[] = {0xffd2, 0xffd2, 0xffd2, 0xffd2};  
    1.31 +static unsigned short MMX_Ublu5x5[] = {0x0081, 0x0081, 0x0081, 0x0081};
    1.32 +static unsigned short MMX_Vred5x5[] = {0x0066, 0x0066, 0x0066, 0x0066};
    1.33 +static unsigned short MMX_Ugrn555[] = {0xffe7, 0xffe7, 0xffe7, 0xffe7};
    1.34 +static unsigned short MMX_Vgrn555[] = {0xffcc, 0xffcc, 0xffcc, 0xffcc};
    1.35 +static unsigned short MMX_Ugrn565[] = {0xffe8, 0xffe8, 0xffe8, 0xffe8};
    1.36 +static unsigned short MMX_Vgrn565[] = {0xffcd, 0xffcd, 0xffcd, 0xffcd};
    1.37  
    1.38 -static unsigned short ASM_VAR(MMX_Ublu5x5)[] = {0x0081, 0x0081, 0x0081, 0x0081};
    1.39 -static unsigned short ASM_VAR(MMX_Vred5x5)[] = {0x0066, 0x0066, 0x0066, 0x0066};
    1.40 -static unsigned short ASM_VAR(MMX_Ugrn555)[] = {0xffe7, 0xffe7, 0xffe7, 0xffe7};
    1.41 -static unsigned short ASM_VAR(MMX_Vgrn555)[] = {0xffcc, 0xffcc, 0xffcc, 0xffcc};
    1.42 -static unsigned short ASM_VAR(MMX_Ugrn565)[] = {0xffe8, 0xffe8, 0xffe8, 0xffe8};
    1.43 -static unsigned short ASM_VAR(MMX_Vgrn565)[] = {0xffcd, 0xffcd, 0xffcd, 0xffcd};
    1.44 -
    1.45 -static unsigned short ASM_VAR(MMX_red555)[]  = {0x7c00, 0x7c00, 0x7c00, 0x7c00};
    1.46 -static unsigned short ASM_VAR(MMX_red565)[]  = {0xf800, 0xf800, 0xf800, 0xf800};
    1.47 -static unsigned short ASM_VAR(MMX_grn555)[]  = {0x03e0, 0x03e0, 0x03e0, 0x03e0};
    1.48 -static unsigned short ASM_VAR(MMX_grn565)[]  = {0x07e0, 0x07e0, 0x07e0, 0x07e0};
    1.49 -static unsigned short ASM_VAR(MMX_blu5x5)[]  = {0x001f, 0x001f, 0x001f, 0x001f};
    1.50 +static unsigned short MMX_red555[]  = {0x7c00, 0x7c00, 0x7c00, 0x7c00};
    1.51 +static unsigned short MMX_red565[]  = {0xf800, 0xf800, 0xf800, 0xf800};
    1.52 +static unsigned short MMX_grn555[]  = {0x03e0, 0x03e0, 0x03e0, 0x03e0};
    1.53 +static unsigned short MMX_grn565[]  = {0x07e0, 0x07e0, 0x07e0, 0x07e0};
    1.54 +static unsigned short MMX_blu5x5[]  = {0x001f, 0x001f, 0x001f, 0x001f};
    1.55  
    1.56  /**
    1.57     This MMX assembler is my first assembler/MMX program ever.
    1.58 @@ -239,13 +233,13 @@
    1.59  		 :
    1.60  		 : "m" (cr), "r"(cb),"r"(lum),
    1.61  		 "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
    1.62 -         [_MMX_0080w] "m" (*_MMX_0080w),
    1.63 -         [_MMX_00FFw] "m" (*_MMX_00FFw),
    1.64 -         [_MMX_FF00w] "m" (*_MMX_FF00w),
    1.65 -         [_MMX_VgrnRGB] "m" (*_MMX_VgrnRGB),
    1.66 -         [_MMX_VredRGB] "m" (*_MMX_VredRGB),
    1.67 -         [_MMX_UgrnRGB] "m" (*_MMX_UgrnRGB),
    1.68 -         [_MMX_UbluRGB] "m" (*_MMX_UbluRGB)
    1.69 +         [_MMX_0080w] "m" (*MMX_0080w),
    1.70 +         [_MMX_00FFw] "m" (*MMX_00FFw),
    1.71 +         [_MMX_FF00w] "m" (*MMX_FF00w),
    1.72 +         [_MMX_VgrnRGB] "m" (*MMX_VgrnRGB),
    1.73 +         [_MMX_VredRGB] "m" (*MMX_VredRGB),
    1.74 +         [_MMX_UgrnRGB] "m" (*MMX_UgrnRGB),
    1.75 +         [_MMX_UbluRGB] "m" (*MMX_UbluRGB)
    1.76  		 );
    1.77  }
    1.78  
    1.79 @@ -417,18 +411,18 @@
    1.80  	 "jl             1b\n"
    1.81           "emms\n"
    1.82  	 "popl %%ebx\n"
    1.83 -         :
    1.84 -         :"m" (cr), "r"(cb),"r"(lum),
    1.85 +	:
    1.86 +	:"m" (cr), "r"(cb),"r"(lum),
    1.87  	 "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
    1.88 -     [_MMX_0080w] "m" (*_MMX_0080w),
    1.89 - [_MMX_Ugrn565] "m" (*_MMX_Ugrn565),
    1.90 - [_MMX_Ublu5x5] "m" (*_MMX_Ublu5x5),
    1.91 - [_MMX_00FFw] "m" (*_MMX_00FFw),
    1.92 - [_MMX_Vgrn565] "m" (*_MMX_Vgrn565),
    1.93 - [_MMX_Vred5x5] "m" (*_MMX_Vred5x5),
    1.94 - [_MMX_Ycoeff] "m" (*_MMX_Ycoeff),
    1.95 - [_MMX_red565] "m" (*_MMX_red565),
    1.96 - [_MMX_grn565] "m" (*_MMX_grn565)
    1.97 +	[_MMX_0080w] "m" (*MMX_0080w),
    1.98 +	[_MMX_Ugrn565] "m" (*MMX_Ugrn565),
    1.99 +	[_MMX_Ublu5x5] "m" (*MMX_Ublu5x5),
   1.100 +	[_MMX_00FFw] "m" (*MMX_00FFw),
   1.101 +	[_MMX_Vgrn565] "m" (*MMX_Vgrn565),
   1.102 +	[_MMX_Vred5x5] "m" (*MMX_Vred5x5),
   1.103 +	[_MMX_Ycoeff] "m" (*MMX_Ycoeff),
   1.104 +	[_MMX_red565] "m" (*MMX_red565),
   1.105 +	[_MMX_grn565] "m" (*MMX_grn565)
   1.106           );
   1.107  }
   1.108