src/video/SDL_yuv_mmx.c
changeset 887 b4b64bb88f2f
parent 769 b8d311d90021
child 946 8520712f8ef0
     1.1 --- a/src/video/SDL_yuv_mmx.c	Thu May 06 15:55:06 2004 +0000
     1.2 +++ b/src/video/SDL_yuv_mmx.c	Sun May 16 17:19:48 2004 +0000
     1.3 @@ -120,12 +120,12 @@
     1.4  		 "movd (%2), %%mm2\n"           //    0  0  0  0 l3 l2 l1 l0
     1.5  		 "punpcklbw %%mm7,%%mm1\n" //         0  v3 0  v2 00 v1 00 v0
     1.6  		 "punpckldq %%mm1,%%mm1\n" //         00 v1 00 v0 00 v1 00 v0
     1.7 -		 "psubw _MMX_0080w,%%mm1\n"  // mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 
     1.8 +		 "psubw %[_MMX_0080w],%%mm1\n"  // mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 
     1.9  
    1.10  		 // create Cr_g (result in mm0)
    1.11  		 "movq %%mm1,%%mm0\n"           // r1 r1 r0 r0 r1 r1 r0 r0
    1.12 -		 "pmullw _MMX_VgrnRGB,%%mm0\n"// red*-46dec=0.7136*64
    1.13 -		 "pmullw _MMX_VredRGB,%%mm1\n"// red*89dec=1.4013*64
    1.14 +		 "pmullw %[_MMX_VgrnRGB],%%mm0\n"// red*-46dec=0.7136*64
    1.15 +		 "pmullw %[_MMX_VredRGB],%%mm1\n"// red*89dec=1.4013*64
    1.16  		 "psraw  $6, %%mm0\n"           // red=red/64
    1.17  		 "psraw  $6, %%mm1\n"           // red=red/64
    1.18  		 
    1.19 @@ -134,8 +134,8 @@
    1.20  		 "movq (%2,%4),%%mm3\n"         //    0  0  0  0 L3 L2 L1 L0
    1.21  		 "punpckldq %%mm3,%%mm2\n"      //   L3 L2 L1 L0 l3 l2 l1 l0
    1.22  		 "movq %%mm2,%%mm4\n"           //   L3 L2 L1 L0 l3 l2 l1 l0
    1.23 -		 "pand _MMX_FF00w,%%mm2\n"      //   L3 0  L1  0 l3  0 l1  0
    1.24 -		 "pand _MMX_00FFw,%%mm4\n"      //   0  L2  0 L0  0 l2  0 l0
    1.25 +		 "pand %[_MMX_FF00w],%%mm2\n"      //   L3 0  L1  0 l3  0 l1  0
    1.26 +		 "pand %[_MMX_00FFw],%%mm4\n"      //   0  L2  0 L0  0 l2  0 l0
    1.27  		 "psrlw $8,%%mm2\n"             //   0  L3  0 L1  0 l3  0 l1
    1.28  
    1.29  		 // create R (result in mm6)
    1.30 @@ -152,11 +152,11 @@
    1.31  		 "movd (%1), %%mm1\n"      //         0  0  0  0  u3 u2 u1 u0
    1.32  		 "punpcklbw %%mm7,%%mm1\n" //         0  u3 0  u2 00 u1 00 u0
    1.33  		 "punpckldq %%mm1,%%mm1\n" //         00 u1 00 u0 00 u1 00 u0
    1.34 -		 "psubw _MMX_0080w,%%mm1\n"  // mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 
    1.35 +		 "psubw %[_MMX_0080w],%%mm1\n"  // mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 
    1.36  		 // create Cb_g (result in mm5)
    1.37  		 "movq %%mm1,%%mm5\n"            // u1 u1 u0 u0 u1 u1 u0 u0
    1.38 -		 "pmullw _MMX_UgrnRGB,%%mm5\n"    // blue*-109dec=1.7129*64
    1.39 -		 "pmullw _MMX_UbluRGB,%%mm1\n"    // blue*114dec=1.78125*64
    1.40 +		 "pmullw %[_MMX_UgrnRGB],%%mm5\n"    // blue*-109dec=1.7129*64
    1.41 +		 "pmullw %[_MMX_UbluRGB],%%mm1\n"    // blue*114dec=1.78125*64
    1.42  		 "psraw  $6, %%mm5\n"            // blue=red/64
    1.43  		 "psraw  $6, %%mm1\n"            // blue=blue/64
    1.44  
    1.45 @@ -238,8 +238,14 @@
    1.46  		 "popl %%ebx\n"
    1.47  		 :
    1.48  		 : "m" (cr), "r"(cb),"r"(lum),
    1.49 -		 "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod)
    1.50 -		 : "%ebx"
    1.51 +		 "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
    1.52 +         [_MMX_0080w] "m" (*_MMX_0080w),
    1.53 +         [_MMX_00FFw] "m" (*_MMX_00FFw),
    1.54 +         [_MMX_FF00w] "m" (*_MMX_FF00w),
    1.55 +         [_MMX_VgrnRGB] "m" (*_MMX_VgrnRGB),
    1.56 +         [_MMX_VredRGB] "m" (*_MMX_VredRGB),
    1.57 +         [_MMX_UgrnRGB] "m" (*_MMX_UgrnRGB),
    1.58 +         [_MMX_UbluRGB] "m" (*_MMX_UbluRGB)
    1.59  		 );
    1.60  }
    1.61  
    1.62 @@ -413,8 +419,16 @@
    1.63  	 "popl %%ebx\n"
    1.64           :
    1.65           :"m" (cr), "r"(cb),"r"(lum),
    1.66 -	 "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod)
    1.67 -	 : "%ebx"
    1.68 +	 "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
    1.69 +     [_MMX_0080w] "m" (*_MMX_0080w),
    1.70 + [_MMX_Ugrn565] "m" (*_MMX_Ugrn565),
    1.71 + [_MMX_Ublu5x5] "m" (*_MMX_Ublu5x5),
    1.72 + [_MMX_00FFw] "m" (*_MMX_00FFw),
    1.73 + [_MMX_Vgrn565] "m" (*_MMX_Vgrn565),
    1.74 + [_MMX_Vred5x5] "m" (*_MMX_Vred5x5),
    1.75 + [_MMX_Ycoeff] "m" (*_MMX_Ycoeff),
    1.76 + [_MMX_red565] "m" (*_MMX_red565),
    1.77 + [_MMX_grn565] "m" (*_MMX_grn565)
    1.78           );
    1.79  }
    1.80