Cleaned up tabs. SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Wed, 11 Jul 2007 07:21:39 +0000
branchSDL-1.2
changeset 40463a9e60224efe
parent 4045 f420bba13676
child 4047 810c6f4ab7aa
Cleaned up tabs.
src/video/SDL_yuv_mmx.c
     1.1 --- a/src/video/SDL_yuv_mmx.c	Wed Jul 11 06:26:22 2007 +0000
     1.2 +++ b/src/video/SDL_yuv_mmx.c	Wed Jul 11 07:21:39 2007 +0000
     1.3 @@ -95,149 +95,149 @@
     1.4  	mod = (mod+cols+mod)*4;               // increment for row1 in byte
     1.5  
     1.6  	__asm__ __volatile__ (
     1.7 -		 // tap dance to workaround the inability to use %%ebx at will...
     1.8 -		 //  move one thing to the stack...
     1.9 -		 "pushl $0\n"  // save a slot on the stack.
    1.10 -		 "pushl %%ebx\n"  // save %%ebx.
    1.11 -		 "movl %0, %%ebx\n"  // put the thing in ebx.
    1.12 -		 "movl %%ebx, 4(%%esp)\n"  // put the thing in the stack slot.
    1.13 -		 "popl %%ebx\n"  // get back %%ebx (the PIC register).
    1.14 +		// tap dance to workaround the inability to use %%ebx at will...
    1.15 +		//  move one thing to the stack...
    1.16 +		"pushl $0\n"  // save a slot on the stack.
    1.17 +		"pushl %%ebx\n"  // save %%ebx.
    1.18 +		"movl %0, %%ebx\n"  // put the thing in ebx.
    1.19 +		"movl %%ebx,4(%%esp)\n"  // put the thing in the stack slot.
    1.20 +		"popl %%ebx\n"  // get back %%ebx (the PIC register).
    1.21 +
    1.22 +		".align 8\n"
    1.23 +		"1:\n"
    1.24  
    1.25 -		 ".align 8\n"
    1.26 -		 "1:\n"
    1.27 -		
    1.28 -		 // create Cr (result in mm1)
    1.29 -		 "pushl %%ebx\n"
    1.30 -		 "movl 4(%%esp), %%ebx\n"
    1.31 -		 "movd (%%ebx), %%mm1\n"   //         0  0  0  0  v3 v2 v1 v0
    1.32 -		 "popl %%ebx\n"
    1.33 -		 "pxor %%mm7,%%mm7\n"      //         00 00 00 00 00 00 00 00
    1.34 -		 "movd (%2), %%mm2\n"           //    0  0  0  0 l3 l2 l1 l0
    1.35 -		 "punpcklbw %%mm7,%%mm1\n" //         0  v3 0  v2 00 v1 00 v0
    1.36 -		 "punpckldq %%mm1,%%mm1\n" //         00 v1 00 v0 00 v1 00 v0
    1.37 -		 "psubw %9,%%mm1\n"        // mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 
    1.38 +		// create Cr (result in mm1)
    1.39 +		"pushl %%ebx\n"
    1.40 +		"movl 4(%%esp),%%ebx\n"
    1.41 +		"movd (%%ebx),%%mm1\n"   //         0  0  0  0  v3 v2 v1 v0
    1.42 +		"popl %%ebx\n"
    1.43 +		"pxor %%mm7,%%mm7\n"      //         00 00 00 00 00 00 00 00
    1.44 +		"movd (%2), %%mm2\n"           //    0  0  0  0 l3 l2 l1 l0
    1.45 +		"punpcklbw %%mm7,%%mm1\n" //         0  v3 0  v2 00 v1 00 v0
    1.46 +		"punpckldq %%mm1,%%mm1\n" //         00 v1 00 v0 00 v1 00 v0
    1.47 +		"psubw %9,%%mm1\n"        // mm1-128:r1 r1 r0 r0 r1 r1 r0 r0
    1.48  
    1.49  		 // create Cr_g (result in mm0)
    1.50 -		 "movq %%mm1,%%mm0\n"           // r1 r1 r0 r0 r1 r1 r0 r0
    1.51 -		 "pmullw %10,%%mm0\n"           // red*-46dec=0.7136*64
    1.52 -		 "pmullw %11,%%mm1\n"           // red*89dec=1.4013*64
    1.53 -		 "psraw  $6, %%mm0\n"           // red=red/64
    1.54 -		 "psraw  $6, %%mm1\n"           // red=red/64
    1.55 -		 
    1.56 -		 // create L1 L2 (result in mm2,mm4)
    1.57 -		 // L2=lum+cols
    1.58 -		 "movq (%2,%4),%%mm3\n"         //    0  0  0  0 L3 L2 L1 L0
    1.59 -		 "punpckldq %%mm3,%%mm2\n"      //   L3 L2 L1 L0 l3 l2 l1 l0
    1.60 -		 "movq %%mm2,%%mm4\n"           //   L3 L2 L1 L0 l3 l2 l1 l0
    1.61 -		 "pand %12,%%mm2\n"             //   L3 0  L1  0 l3  0 l1  0
    1.62 -		 "pand %13,%%mm4\n"             //   0  L2  0 L0  0 l2  0 l0
    1.63 -		 "psrlw $8,%%mm2\n"             //   0  L3  0 L1  0 l3  0 l1
    1.64 +		"movq %%mm1,%%mm0\n"           // r1 r1 r0 r0 r1 r1 r0 r0
    1.65 +		"pmullw %10,%%mm0\n"           // red*-46dec=0.7136*64
    1.66 +		"pmullw %11,%%mm1\n"           // red*89dec=1.4013*64
    1.67 +		"psraw  $6, %%mm0\n"           // red=red/64
    1.68 +		"psraw  $6, %%mm1\n"           // red=red/64
    1.69  
    1.70 -		 // create R (result in mm6)
    1.71 -		 "movq %%mm2,%%mm5\n"           //   0 L3  0 L1  0 l3  0 l1
    1.72 -		 "movq %%mm4,%%mm6\n"           //   0 L2  0 L0  0 l2  0 l0
    1.73 -		 "paddsw  %%mm1, %%mm5\n"       // lum1+red:x R3 x R1 x r3 x r1
    1.74 -		 "paddsw  %%mm1, %%mm6\n"       // lum1+red:x R2 x R0 x r2 x r0
    1.75 -		 "packuswb %%mm5,%%mm5\n"       //  R3 R1 r3 r1 R3 R1 r3 r1
    1.76 -		 "packuswb %%mm6,%%mm6\n"       //  R2 R0 r2 r0 R2 R0 r2 r0
    1.77 -		 "pxor %%mm7,%%mm7\n"      //         00 00 00 00 00 00 00 00
    1.78 -		 "punpcklbw %%mm5,%%mm6\n"      //  R3 R2 R1 R0 r3 r2 r1 r0
    1.79 +		// create L1 L2 (result in mm2,mm4)
    1.80 +		// L2=lum+cols
    1.81 +		"movq (%2,%4),%%mm3\n"         //    0  0  0  0 L3 L2 L1 L0
    1.82 +		"punpckldq %%mm3,%%mm2\n"      //   L3 L2 L1 L0 l3 l2 l1 l0
    1.83 +		"movq %%mm2,%%mm4\n"           //   L3 L2 L1 L0 l3 l2 l1 l0
    1.84 +		"pand %12,%%mm2\n"             //   L3 0  L1  0 l3  0 l1  0
    1.85 +		"pand %13,%%mm4\n"             //   0  L2  0 L0  0 l2  0 l0
    1.86 +		"psrlw $8,%%mm2\n"             //   0  L3  0 L1  0 l3  0 l1
    1.87 +
    1.88 +		// create R (result in mm6)
    1.89 +		"movq %%mm2,%%mm5\n"           //   0 L3  0 L1  0 l3  0 l1
    1.90 +		"movq %%mm4,%%mm6\n"           //   0 L2  0 L0  0 l2  0 l0
    1.91 +		"paddsw  %%mm1, %%mm5\n"       // lum1+red:x R3 x R1 x r3 x r1
    1.92 +		"paddsw  %%mm1, %%mm6\n"       // lum1+red:x R2 x R0 x r2 x r0
    1.93 +		"packuswb %%mm5,%%mm5\n"       //  R3 R1 r3 r1 R3 R1 r3 r1
    1.94 +		"packuswb %%mm6,%%mm6\n"       //  R2 R0 r2 r0 R2 R0 r2 r0
    1.95 +		"pxor %%mm7,%%mm7\n"      //         00 00 00 00 00 00 00 00
    1.96 +		"punpcklbw %%mm5,%%mm6\n"      //  R3 R2 R1 R0 r3 r2 r1 r0
    1.97  
    1.98 -		 // create Cb (result in mm1)
    1.99 -		 "movd (%1), %%mm1\n"      //         0  0  0  0  u3 u2 u1 u0
   1.100 -		 "punpcklbw %%mm7,%%mm1\n" //         0  u3 0  u2 00 u1 00 u0
   1.101 -		 "punpckldq %%mm1,%%mm1\n" //         00 u1 00 u0 00 u1 00 u0
   1.102 -		 "psubw %9,%%mm1\n"        // mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 
   1.103 -		 // create Cb_g (result in mm5)
   1.104 -		 "movq %%mm1,%%mm5\n"            // u1 u1 u0 u0 u1 u1 u0 u0
   1.105 -		 "pmullw %14,%%mm5\n"            // blue*-109dec=1.7129*64
   1.106 -		 "pmullw %15,%%mm1\n"            // blue*114dec=1.78125*64
   1.107 -		 "psraw  $6, %%mm5\n"            // blue=red/64
   1.108 -		 "psraw  $6, %%mm1\n"            // blue=blue/64
   1.109 +		// create Cb (result in mm1)
   1.110 +		"movd (%1), %%mm1\n"      //         0  0  0  0  u3 u2 u1 u0
   1.111 +		"punpcklbw %%mm7,%%mm1\n" //         0  u3 0  u2 00 u1 00 u0
   1.112 +		"punpckldq %%mm1,%%mm1\n" //         00 u1 00 u0 00 u1 00 u0
   1.113 +		"psubw %9,%%mm1\n"        // mm1-128:u1 u1 u0 u0 u1 u1 u0 u0
   1.114 +		// create Cb_g (result in mm5)
   1.115 +		"movq %%mm1,%%mm5\n"            // u1 u1 u0 u0 u1 u1 u0 u0
   1.116 +		"pmullw %14,%%mm5\n"            // blue*-109dec=1.7129*64
   1.117 +		"pmullw %15,%%mm1\n"            // blue*114dec=1.78125*64
   1.118 +		"psraw  $6, %%mm5\n"            // blue=red/64
   1.119 +		"psraw  $6, %%mm1\n"            // blue=blue/64
   1.120  
   1.121 -		 // create G (result in mm7)
   1.122 -		 "movq %%mm2,%%mm3\n"      //   0  L3  0 L1  0 l3  0 l1
   1.123 -		 "movq %%mm4,%%mm7\n"      //   0  L2  0 L0  0 l2  0 l1
   1.124 -		 "paddsw  %%mm5, %%mm3\n"  // lum1+Cb_g:x G3t x G1t x g3t x g1t
   1.125 -		 "paddsw  %%mm5, %%mm7\n"  // lum1+Cb_g:x G2t x G0t x g2t x g0t
   1.126 -		 "paddsw  %%mm0, %%mm3\n"  // lum1+Cr_g:x G3  x G1  x g3  x g1
   1.127 -		 "paddsw  %%mm0, %%mm7\n"  // lum1+blue:x G2  x G0  x g2  x g0
   1.128 -		 "packuswb %%mm3,%%mm3\n"  // G3 G1 g3 g1 G3 G1 g3 g1
   1.129 -		 "packuswb %%mm7,%%mm7\n"  // G2 G0 g2 g0 G2 G0 g2 g0
   1.130 -		 "punpcklbw %%mm3,%%mm7\n" // G3 G2 G1 G0 g3 g2 g1 g0
   1.131 -		 
   1.132 -		 // create B (result in mm5)
   1.133 -		 "movq %%mm2,%%mm3\n"         //   0  L3  0 L1  0 l3  0 l1
   1.134 -		 "movq %%mm4,%%mm5\n"         //   0  L2  0 L0  0 l2  0 l1
   1.135 -		 "paddsw  %%mm1, %%mm3\n"     // lum1+blue:x B3 x B1 x b3 x b1
   1.136 -		 "paddsw  %%mm1, %%mm5\n"     // lum1+blue:x B2 x B0 x b2 x b0
   1.137 -		 "packuswb %%mm3,%%mm3\n"     // B3 B1 b3 b1 B3 B1 b3 b1
   1.138 -		 "packuswb %%mm5,%%mm5\n"     // B2 B0 b2 b0 B2 B0 b2 b0
   1.139 -		 "punpcklbw %%mm3,%%mm5\n"    // B3 B2 B1 B0 b3 b2 b1 b0
   1.140 +		// create G (result in mm7)
   1.141 +		"movq %%mm2,%%mm3\n"      //   0  L3  0 L1  0 l3  0 l1
   1.142 +		"movq %%mm4,%%mm7\n"      //   0  L2  0 L0  0 l2  0 l1
   1.143 +		"paddsw  %%mm5, %%mm3\n"  // lum1+Cb_g:x G3t x G1t x g3t x g1t
   1.144 +		"paddsw  %%mm5, %%mm7\n"  // lum1+Cb_g:x G2t x G0t x g2t x g0t
   1.145 +		"paddsw  %%mm0, %%mm3\n"  // lum1+Cr_g:x G3  x G1  x g3  x g1
   1.146 +		"paddsw  %%mm0, %%mm7\n"  // lum1+blue:x G2  x G0  x g2  x g0
   1.147 +		"packuswb %%mm3,%%mm3\n"  // G3 G1 g3 g1 G3 G1 g3 g1
   1.148 +		"packuswb %%mm7,%%mm7\n"  // G2 G0 g2 g0 G2 G0 g2 g0
   1.149 +		"punpcklbw %%mm3,%%mm7\n" // G3 G2 G1 G0 g3 g2 g1 g0
   1.150  
   1.151 -		 // fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb)
   1.152 +		// create B (result in mm5)
   1.153 +		"movq %%mm2,%%mm3\n"         //   0  L3  0 L1  0 l3  0 l1
   1.154 +		"movq %%mm4,%%mm5\n"         //   0  L2  0 L0  0 l2  0 l1
   1.155 +		"paddsw  %%mm1, %%mm3\n"     // lum1+blue:x B3 x B1 x b3 x b1
   1.156 +		"paddsw  %%mm1, %%mm5\n"     // lum1+blue:x B2 x B0 x b2 x b0
   1.157 +		"packuswb %%mm3,%%mm3\n"     // B3 B1 b3 b1 B3 B1 b3 b1
   1.158 +		"packuswb %%mm5,%%mm5\n"     // B2 B0 b2 b0 B2 B0 b2 b0
   1.159 +		"punpcklbw %%mm3,%%mm5\n"    // B3 B2 B1 B0 b3 b2 b1 b0
   1.160 +
   1.161 +		// fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb)
   1.162  
   1.163 -		 "pxor %%mm2,%%mm2\n"           //  0  0  0  0  0  0  0  0
   1.164 -		 "pxor %%mm4,%%mm4\n"           //  0  0  0  0  0  0  0  0
   1.165 -		 "movq %%mm6,%%mm1\n"           // R3 R2 R1 R0 r3 r2 r1 r0
   1.166 -		 "movq %%mm5,%%mm3\n"           // B3 B2 B1 B0 b3 b2 b1 b0
   1.167 -		 // process lower lum
   1.168 -		 "punpcklbw %%mm4,%%mm1\n"      //  0 r3  0 r2  0 r1  0 r0
   1.169 -		 "punpcklbw %%mm4,%%mm3\n"      //  0 b3  0 b2  0 b1  0 b0
   1.170 -		 "movq %%mm1,%%mm2\n"           //  0 r3  0 r2  0 r1  0 r0
   1.171 -		 "movq %%mm3,%%mm0\n"           //  0 b3  0 b2  0 b1  0 b0
   1.172 -		 "punpcklwd %%mm1,%%mm3\n"      //  0 r1  0 b1  0 r0  0 b0
   1.173 -		 "punpckhwd %%mm2,%%mm0\n"      //  0 r3  0 b3  0 r2  0 b2
   1.174 +		"pxor %%mm2,%%mm2\n"           //  0  0  0  0  0  0  0  0
   1.175 +		"pxor %%mm4,%%mm4\n"           //  0  0  0  0  0  0  0  0
   1.176 +		"movq %%mm6,%%mm1\n"           // R3 R2 R1 R0 r3 r2 r1 r0
   1.177 +		"movq %%mm5,%%mm3\n"           // B3 B2 B1 B0 b3 b2 b1 b0
   1.178 +		// process lower lum
   1.179 +		"punpcklbw %%mm4,%%mm1\n"      //  0 r3  0 r2  0 r1  0 r0
   1.180 +		"punpcklbw %%mm4,%%mm3\n"      //  0 b3  0 b2  0 b1  0 b0
   1.181 +		"movq %%mm1,%%mm2\n"           //  0 r3  0 r2  0 r1  0 r0
   1.182 +		"movq %%mm3,%%mm0\n"           //  0 b3  0 b2  0 b1  0 b0
   1.183 +		"punpcklwd %%mm1,%%mm3\n"      //  0 r1  0 b1  0 r0  0 b0
   1.184 +		"punpckhwd %%mm2,%%mm0\n"      //  0 r3  0 b3  0 r2  0 b2
   1.185  
   1.186 -		 "pxor %%mm2,%%mm2\n"           //  0  0  0  0  0  0  0  0
   1.187 -		 "movq %%mm7,%%mm1\n"           // G3 G2 G1 G0 g3 g2 g1 g0
   1.188 -		 "punpcklbw %%mm1,%%mm2\n"      // g3  0 g2  0 g1  0 g0  0
   1.189 -		 "punpcklwd %%mm4,%%mm2\n"      //  0  0 g1  0  0  0 g0  0 
   1.190 -		 "por  %%mm3, %%mm2\n"          //  0 r1 g1 b1  0 r0 g0 b0
   1.191 -		 "movq   %%mm2,(%3)\n"          // wrote out ! row1
   1.192 +		"pxor %%mm2,%%mm2\n"           //  0  0  0  0  0  0  0  0
   1.193 +		"movq %%mm7,%%mm1\n"           // G3 G2 G1 G0 g3 g2 g1 g0
   1.194 +		"punpcklbw %%mm1,%%mm2\n"      // g3  0 g2  0 g1  0 g0  0
   1.195 +		"punpcklwd %%mm4,%%mm2\n"      //  0  0 g1  0  0  0 g0  0
   1.196 +		"por %%mm3, %%mm2\n"          //  0 r1 g1 b1  0 r0 g0 b0
   1.197 +		"movq %%mm2,(%3)\n"          // wrote out ! row1
   1.198  
   1.199 -		 "pxor %%mm2,%%mm2\n"           //  0  0  0  0  0  0  0  0
   1.200 -		 "punpcklbw %%mm1,%%mm4\n"      // g3  0 g2  0 g1  0 g0  0
   1.201 -		 "punpckhwd %%mm2,%%mm4\n"      //  0  0 g3  0  0  0 g2  0 
   1.202 -		 "por  %%mm0, %%mm4\n"          //  0 r3 g3 b3  0 r2 g2 b2
   1.203 -		 "movq   %%mm4,8(%3)\n"         // wrote out ! row1
   1.204 +		"pxor %%mm2,%%mm2\n"           //  0  0  0  0  0  0  0  0
   1.205 +		"punpcklbw %%mm1,%%mm4\n"      // g3  0 g2  0 g1  0 g0  0
   1.206 +		"punpckhwd %%mm2,%%mm4\n"      //  0  0 g3  0  0  0 g2  0
   1.207 +		"por %%mm0, %%mm4\n"          //  0 r3 g3 b3  0 r2 g2 b2
   1.208 +		"movq %%mm4,8(%3)\n"         // wrote out ! row1
   1.209  		 
   1.210 -		 // fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb)
   1.211 -		 // this can be done "destructive"
   1.212 -		 "pxor %%mm2,%%mm2\n"           //  0  0  0  0  0  0  0  0
   1.213 -		 "punpckhbw %%mm2,%%mm6\n"      //  0 R3  0 R2  0 R1  0 R0
   1.214 -		 "punpckhbw %%mm1,%%mm5\n"      // G3 B3 G2 B2 G1 B1 G0 B0
   1.215 -		 "movq %%mm5,%%mm1\n"           // G3 B3 G2 B2 G1 B1 G0 B0
   1.216 -		 "punpcklwd %%mm6,%%mm1\n"      //  0 R1 G1 B1  0 R0 G0 B0
   1.217 -		 "movq   %%mm1,(%5)\n"          // wrote out ! row2
   1.218 -		 "punpckhwd %%mm6,%%mm5\n"      //  0 R3 G3 B3  0 R2 G2 B2
   1.219 -		 "movq   %%mm5,8(%5)\n"         // wrote out ! row2
   1.220 +		// fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb)
   1.221 +		// this can be done "destructive"
   1.222 +		"pxor %%mm2,%%mm2\n"           //  0  0  0  0  0  0  0  0
   1.223 +		"punpckhbw %%mm2,%%mm6\n"      //  0 R3  0 R2  0 R1  0 R0
   1.224 +		"punpckhbw %%mm1,%%mm5\n"      // G3 B3 G2 B2 G1 B1 G0 B0
   1.225 +		"movq %%mm5,%%mm1\n"           // G3 B3 G2 B2 G1 B1 G0 B0
   1.226 +		"punpcklwd %%mm6,%%mm1\n"      //  0 R1 G1 B1  0 R0 G0 B0
   1.227 +		"movq %%mm1,(%5)\n"          // wrote out ! row2
   1.228 +		"punpckhwd %%mm6,%%mm5\n"      //  0 R3 G3 B3  0 R2 G2 B2
   1.229 +		"movq %%mm5,8(%5)\n"         // wrote out ! row2
   1.230  		 
   1.231 -		 "addl  $4,%2\n"            // lum+4
   1.232 -		 "leal  16(%3),%3\n"        // row1+16
   1.233 -		 "leal  16(%5),%5\n"        // row2+16
   1.234 -		 "addl  $2, (%%esp)\n"        // cr+2
   1.235 -		 "addl  $2, %1\n"           // cb+2
   1.236 +		"addl $4,%2\n"            // lum+4
   1.237 +		"leal 16(%3),%3\n"        // row1+16
   1.238 +		"leal 16(%5),%5\n"        // row2+16
   1.239 +		"addl $2,(%%esp)\n"        // cr+2
   1.240 +		"addl $2,%1\n"           // cb+2
   1.241  
   1.242 -		 "addl  $4,%6\n"            // x+4
   1.243 -		 "cmpl  %4,%6\n"
   1.244 +		"addl $4,%6\n"            // x+4
   1.245 +		"cmpl %4,%6\n"
   1.246  
   1.247 -		 "jl    1b\n"
   1.248 -		 "addl           %4,     %2\n" // lum += cols 
   1.249 -		 "addl           %8,     %3\n" // row1+= mod
   1.250 -		 "addl           %8,     %5\n" // row2+= mod
   1.251 -		 "movl           $0,     %6\n" // x=0
   1.252 -		 "cmpl           %7,     %2\n"
   1.253 -		 "jl             1b\n"
   1.254 +		"jl 1b\n"
   1.255 +		"addl %4,%2\n" // lum += cols
   1.256 +		"addl %8,%3\n" // row1+= mod
   1.257 +		"addl %8,%5\n" // row2+= mod
   1.258 +		"movl $0,%6\n" // x=0
   1.259 +		"cmpl %7,%2\n"
   1.260 +		"jl 1b\n"
   1.261  
   1.262 -		 "addl $4, %%esp\n"  // get rid of the stack slot we reserved.
   1.263 -		 "emms\n"  // reset MMX registers.
   1.264 -		 :
   1.265 -		 : "m" (cr), "r"(cb),"r"(lum),
   1.266 -		   "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
   1.267 -		   "m"(MMX_0080w),"m"(MMX_VgrnRGB),"m"(MMX_VredRGB),
   1.268 -		   "m"(MMX_FF00w),"m"(MMX_00FFw),"m"(MMX_UgrnRGB),
   1.269 -		   "m"(MMX_UbluRGB)
   1.270 +		"addl $4,%%esp\n"  // get rid of the stack slot we reserved.
   1.271 +		"emms\n"  // reset MMX registers.
   1.272 +		:
   1.273 +		: "m" (cr), "r"(cb),"r"(lum),
   1.274 +		  "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
   1.275 +		  "m"(MMX_0080w),"m"(MMX_VgrnRGB),"m"(MMX_VredRGB),
   1.276 +		  "m"(MMX_FF00w),"m"(MMX_00FFw),"m"(MMX_UgrnRGB),
   1.277 +		  "m"(MMX_UbluRGB)
   1.278  	);
   1.279  }
   1.280  
   1.281 @@ -246,184 +246,183 @@
   1.282                               unsigned char *cb, unsigned char *out,
   1.283                               int rows, int cols, int mod )
   1.284  {
   1.285 -    Uint16 *row1;
   1.286 -    Uint16 *row2;
   1.287 +	Uint16 *row1;
   1.288 +	Uint16 *row2;
   1.289  
   1.290 -    unsigned char* y = lum +cols*rows;    /* Pointer to the end */
   1.291 -    int x=0;
   1.292 -    row1 = (Uint16 *)out;                 /* 16 bit target */
   1.293 -    row2 = (Uint16 *)out+cols+mod;        /* start of second row  */
   1.294 -    mod = (mod+cols+mod)*2;               /* increment for row1 in byte */
   1.295 -
   1.296 +	unsigned char* y = lum +cols*rows;    /* Pointer to the end */
   1.297 +	int x = 0;
   1.298 +	row1 = (Uint16 *)out;                 /* 16 bit target */
   1.299 +	row2 = (Uint16 *)out+cols+mod;        /* start of second row  */
   1.300 +	mod = (mod+cols+mod)*2;               /* increment for row1 in byte */
   1.301  
   1.302 -      __asm__ __volatile__(
   1.303 -         // tap dance to workaround the inability to use %%ebx at will...
   1.304 -         //  move one thing to the stack...
   1.305 -         "pushl $0\n"  // save a slot on the stack.
   1.306 -         "pushl %%ebx\n"  // save %%ebx.
   1.307 -         "movl %0, %%ebx\n"  // put the thing in ebx.
   1.308 -         "movl %%ebx, 4(%%esp)\n"  // put the thing in the stack slot.
   1.309 -         "popl %%ebx\n"  // get back %%ebx (the PIC register).
   1.310 +	__asm__ __volatile__(
   1.311 +		// tap dance to workaround the inability to use %%ebx at will...
   1.312 +		//  move one thing to the stack...
   1.313 +		"pushl $0\n"  // save a slot on the stack.
   1.314 +		"pushl %%ebx\n"  // save %%ebx.
   1.315 +		"movl %0, %%ebx\n"  // put the thing in ebx.
   1.316 +		"movl %%ebx, 4(%%esp)\n"  // put the thing in the stack slot.
   1.317 +		"popl %%ebx\n"  // get back %%ebx (the PIC register).
   1.318  
   1.319 -         ".align 8\n"
   1.320 -         "1:\n"
   1.321 -         "movd           (%1),                   %%mm0\n" // 4 Cb         0  0  0  0 u3 u2 u1 u0
   1.322 -         "pxor           %%mm7,                  %%mm7\n"
   1.323 -         "pushl %%ebx\n"
   1.324 -         "movl 4(%%esp), %%ebx\n"
   1.325 -         "movd (%%ebx), %%mm1\n"   // 4 Cr                0  0  0  0 v3 v2 v1 v0
   1.326 -         "popl %%ebx\n"
   1.327 +		".align 8\n"
   1.328 +		"1:\n"
   1.329 +		"movd           (%1),                   %%mm0\n" // 4 Cb         0  0  0  0 u3 u2 u1 u0
   1.330 +		"pxor           %%mm7,                  %%mm7\n"
   1.331 +		"pushl %%ebx\n"
   1.332 +		"movl 4(%%esp), %%ebx\n"
   1.333 +		"movd (%%ebx), %%mm1\n"   // 4 Cr                0  0  0  0 v3 v2 v1 v0
   1.334 +		"popl %%ebx\n"
   1.335  
   1.336 -         "punpcklbw      %%mm7,                  %%mm0\n" // 4 W cb   0 u3  0 u2  0 u1  0 u0
   1.337 -         "punpcklbw      %%mm7,                  %%mm1\n" // 4 W cr   0 v3  0 v2  0 v1  0 v0
   1.338 -         "psubw          %9,                     %%mm0\n"
   1.339 -         "psubw          %9,                     %%mm1\n"
   1.340 -         "movq           %%mm0,                  %%mm2\n" // Cb                   0 u3  0 u2  0 u1  0 u0
   1.341 -         "movq           %%mm1,                  %%mm3\n" // Cr
   1.342 -         "pmullw         %10,                    %%mm2\n" // Cb2green 0 R3  0 R2  0 R1  0 R0
   1.343 -         "movq           (%2),                   %%mm6\n" // L1      l7 L6 L5 L4 L3 L2 L1 L0
   1.344 -         "pmullw         %11,                    %%mm0\n" // Cb2blue
   1.345 -         "pand           %12,                    %%mm6\n" // L1      00 L6 00 L4 00 L2 00 L0
   1.346 -         "pmullw         %13,                    %%mm3\n" // Cr2green
   1.347 -         "movq           (%2),                   %%mm7\n" // L2
   1.348 -         "pmullw         %14,                    %%mm1\n" // Cr2red
   1.349 -         "psrlw          $8,                     %%mm7\n"        // L2           00 L7 00 L5 00 L3 00 L1
   1.350 -         "pmullw         %15,                    %%mm6\n" // lum1
   1.351 -         "paddw          %%mm3,                  %%mm2\n" // Cb2green + Cr2green == green
   1.352 -         "pmullw         %15,                    %%mm7\n" // lum2
   1.353 +		"punpcklbw      %%mm7,                  %%mm0\n" // 4 W cb   0 u3  0 u2  0 u1  0 u0
   1.354 +		"punpcklbw      %%mm7,                  %%mm1\n" // 4 W cr   0 v3  0 v2  0 v1  0 v0
   1.355 +		"psubw          %9,                     %%mm0\n"
   1.356 +		"psubw          %9,                     %%mm1\n"
   1.357 +		"movq           %%mm0,                  %%mm2\n" // Cb                   0 u3  0 u2  0 u1  0 u0
   1.358 +		"movq           %%mm1,                  %%mm3\n" // Cr
   1.359 +		"pmullw         %10,                    %%mm2\n" // Cb2green 0 R3  0 R2  0 R1  0 R0
   1.360 +		"movq           (%2),                   %%mm6\n" // L1      l7 L6 L5 L4 L3 L2 L1 L0
   1.361 +		"pmullw         %11,                    %%mm0\n" // Cb2blue
   1.362 +		"pand           %12,                    %%mm6\n" // L1      00 L6 00 L4 00 L2 00 L0
   1.363 +		"pmullw         %13,                    %%mm3\n" // Cr2green
   1.364 +		"movq           (%2),                   %%mm7\n" // L2
   1.365 +		"pmullw         %14,                    %%mm1\n" // Cr2red
   1.366 +		"psrlw          $8,                     %%mm7\n"        // L2           00 L7 00 L5 00 L3 00 L1
   1.367 +		"pmullw         %15,                    %%mm6\n" // lum1
   1.368 +		"paddw          %%mm3,                  %%mm2\n" // Cb2green + Cr2green == green
   1.369 +		"pmullw         %15,                    %%mm7\n" // lum2
   1.370  
   1.371 -         "movq           %%mm6,                  %%mm4\n" // lum1
   1.372 -         "paddw          %%mm0,                  %%mm6\n" // lum1 +blue 00 B6 00 B4 00 B2 00 B0
   1.373 -         "movq           %%mm4,                  %%mm5\n" // lum1
   1.374 -         "paddw          %%mm1,                  %%mm4\n" // lum1 +red  00 R6 00 R4 00 R2 00 R0
   1.375 -         "paddw          %%mm2,                  %%mm5\n" // lum1 +green 00 G6 00 G4 00 G2 00 G0
   1.376 -         "psraw          $6,                     %%mm4\n" // R1 0 .. 64
   1.377 -         "movq           %%mm7,                  %%mm3\n" // lum2                       00 L7 00 L5 00 L3 00 L1
   1.378 -         "psraw          $6,                     %%mm5\n" // G1  - .. +
   1.379 -         "paddw          %%mm0,                  %%mm7\n" // Lum2 +blue 00 B7 00 B5 00 B3 00 B1
   1.380 -         "psraw          $6,                     %%mm6\n" // B1         0 .. 64
   1.381 -         "packuswb       %%mm4,                  %%mm4\n" // R1 R1
   1.382 -         "packuswb       %%mm5,                  %%mm5\n" // G1 G1
   1.383 -         "packuswb       %%mm6,                  %%mm6\n" // B1 B1
   1.384 -         "punpcklbw      %%mm4,                  %%mm4\n"
   1.385 -         "punpcklbw      %%mm5,                  %%mm5\n"
   1.386 +		"movq           %%mm6,                  %%mm4\n" // lum1
   1.387 +		"paddw          %%mm0,                  %%mm6\n" // lum1 +blue 00 B6 00 B4 00 B2 00 B0
   1.388 +		"movq           %%mm4,                  %%mm5\n" // lum1
   1.389 +		"paddw          %%mm1,                  %%mm4\n" // lum1 +red  00 R6 00 R4 00 R2 00 R0
   1.390 +		"paddw          %%mm2,                  %%mm5\n" // lum1 +green 00 G6 00 G4 00 G2 00 G0
   1.391 +		"psraw          $6,                     %%mm4\n" // R1 0 .. 64
   1.392 +		"movq           %%mm7,                  %%mm3\n" // lum2                       00 L7 00 L5 00 L3 00 L1
   1.393 +		"psraw          $6,                     %%mm5\n" // G1  - .. +
   1.394 +		"paddw          %%mm0,                  %%mm7\n" // Lum2 +blue 00 B7 00 B5 00 B3 00 B1
   1.395 +		"psraw          $6,                     %%mm6\n" // B1         0 .. 64
   1.396 +		"packuswb       %%mm4,                  %%mm4\n" // R1 R1
   1.397 +		"packuswb       %%mm5,                  %%mm5\n" // G1 G1
   1.398 +		"packuswb       %%mm6,                  %%mm6\n" // B1 B1
   1.399 +		"punpcklbw      %%mm4,                  %%mm4\n"
   1.400 +		"punpcklbw      %%mm5,                  %%mm5\n"
   1.401  
   1.402 -         "pand           %16,                    %%mm4\n"
   1.403 -         "psllw          $3,                     %%mm5\n" // GREEN       1
   1.404 -         "punpcklbw      %%mm6,                  %%mm6\n"
   1.405 -         "pand           %17,                    %%mm5\n"
   1.406 -         "pand           %16,                    %%mm6\n"
   1.407 -         "por            %%mm5,                  %%mm4\n" //
   1.408 -         "psrlw          $11,                    %%mm6\n" // BLUE        1
   1.409 -         "movq           %%mm3,                  %%mm5\n" // lum2
   1.410 -         "paddw          %%mm1,                  %%mm3\n" // lum2 +red      00 R7 00 R5 00 R3 00 R1
   1.411 -         "paddw          %%mm2,                  %%mm5\n" // lum2 +green 00 G7 00 G5 00 G3 00 G1
   1.412 -         "psraw          $6,                     %%mm3\n" // R2
   1.413 -         "por            %%mm6,                  %%mm4\n" // MM4
   1.414 -         "psraw          $6,                     %%mm5\n" // G2
   1.415 -         "movq           (%2, %4),               %%mm6\n" // L3 load lum2
   1.416 -         "psraw          $6,                     %%mm7\n"
   1.417 -         "packuswb       %%mm3,                  %%mm3\n"
   1.418 -         "packuswb       %%mm5,                  %%mm5\n"
   1.419 -         "packuswb       %%mm7,                  %%mm7\n"
   1.420 -         "pand           %12,                    %%mm6\n" // L3
   1.421 -         "punpcklbw      %%mm3,                  %%mm3\n"
   1.422 -         "punpcklbw      %%mm5,                  %%mm5\n"
   1.423 -         "pmullw         %15,                    %%mm6\n" // lum3
   1.424 -         "punpcklbw      %%mm7,                  %%mm7\n"
   1.425 -         "psllw          $3,                     %%mm5\n" // GREEN 2
   1.426 -         "pand           %16,                    %%mm7\n"
   1.427 -         "pand           %16,                    %%mm3\n"
   1.428 -         "psrlw          $11,                    %%mm7\n" // BLUE  2
   1.429 -         "pand           %17,                    %%mm5\n"
   1.430 -         "por            %%mm7,                  %%mm3\n"
   1.431 -         "movq           (%2,%4),                %%mm7\n" // L4 load lum2
   1.432 -         "por            %%mm5,                  %%mm3\n" //
   1.433 -         "psrlw          $8,                     %%mm7\n" // L4
   1.434 -         "movq           %%mm4,                  %%mm5\n"
   1.435 -         "punpcklwd      %%mm3,                  %%mm4\n"
   1.436 -         "pmullw         %15,                    %%mm7\n" // lum4
   1.437 -         "punpckhwd      %%mm3,                  %%mm5\n"
   1.438 +		"pand           %16,                    %%mm4\n"
   1.439 +		"psllw          $3,                     %%mm5\n" // GREEN       1
   1.440 +		"punpcklbw      %%mm6,                  %%mm6\n"
   1.441 +		"pand           %17,                    %%mm5\n"
   1.442 +		"pand           %16,                    %%mm6\n"
   1.443 +		"por            %%mm5,                  %%mm4\n" //
   1.444 +		"psrlw          $11,                    %%mm6\n" // BLUE        1
   1.445 +		"movq           %%mm3,                  %%mm5\n" // lum2
   1.446 +		"paddw          %%mm1,                  %%mm3\n" // lum2 +red      00 R7 00 R5 00 R3 00 R1
   1.447 +		"paddw          %%mm2,                  %%mm5\n" // lum2 +green 00 G7 00 G5 00 G3 00 G1
   1.448 +		"psraw          $6,                     %%mm3\n" // R2
   1.449 +		"por            %%mm6,                  %%mm4\n" // MM4
   1.450 +		"psraw          $6,                     %%mm5\n" // G2
   1.451 +		"movq           (%2, %4),               %%mm6\n" // L3 load lum2
   1.452 +		"psraw          $6,                     %%mm7\n"
   1.453 +		"packuswb       %%mm3,                  %%mm3\n"
   1.454 +		"packuswb       %%mm5,                  %%mm5\n"
   1.455 +		"packuswb       %%mm7,                  %%mm7\n"
   1.456 +		"pand           %12,                    %%mm6\n" // L3
   1.457 +		"punpcklbw      %%mm3,                  %%mm3\n"
   1.458 +		"punpcklbw      %%mm5,                  %%mm5\n"
   1.459 +		"pmullw         %15,                    %%mm6\n" // lum3
   1.460 +		"punpcklbw      %%mm7,                  %%mm7\n"
   1.461 +		"psllw          $3,                     %%mm5\n" // GREEN 2
   1.462 +		"pand           %16,                    %%mm7\n"
   1.463 +		"pand           %16,                    %%mm3\n"
   1.464 +		"psrlw          $11,                    %%mm7\n" // BLUE  2
   1.465 +		"pand           %17,                    %%mm5\n"
   1.466 +		"por            %%mm7,                  %%mm3\n"
   1.467 +		"movq           (%2,%4),                %%mm7\n" // L4 load lum2
   1.468 +		"por            %%mm5,                  %%mm3\n" //
   1.469 +		"psrlw          $8,                     %%mm7\n" // L4
   1.470 +		"movq           %%mm4,                  %%mm5\n"
   1.471 +		"punpcklwd      %%mm3,                  %%mm4\n"
   1.472 +		"pmullw         %15,                    %%mm7\n" // lum4
   1.473 +		"punpckhwd      %%mm3,                  %%mm5\n"
   1.474  
   1.475 -         "movq           %%mm4,                  (%3)\n"  // write row1
   1.476 -         "movq           %%mm5,                  8(%3)\n" // write row1
   1.477 +		"movq           %%mm4,                  (%3)\n"  // write row1
   1.478 +		"movq           %%mm5,                  8(%3)\n" // write row1
   1.479  
   1.480 -         "movq           %%mm6,                  %%mm4\n" // Lum3
   1.481 -         "paddw          %%mm0,                  %%mm6\n" // Lum3 +blue
   1.482 +		"movq           %%mm6,                  %%mm4\n" // Lum3
   1.483 +		"paddw          %%mm0,                  %%mm6\n" // Lum3 +blue
   1.484  
   1.485 -         "movq           %%mm4,                  %%mm5\n" // Lum3
   1.486 -         "paddw          %%mm1,                  %%mm4\n" // Lum3 +red
   1.487 -         "paddw          %%mm2,                  %%mm5\n" // Lum3 +green
   1.488 -         "psraw          $6,                     %%mm4\n"
   1.489 -         "movq           %%mm7,                  %%mm3\n" // Lum4
   1.490 -         "psraw          $6,                     %%mm5\n"
   1.491 -         "paddw          %%mm0,                  %%mm7\n" // Lum4 +blue
   1.492 -         "psraw          $6,                     %%mm6\n" // Lum3 +blue
   1.493 -         "movq           %%mm3,                  %%mm0\n" // Lum4
   1.494 -         "packuswb       %%mm4,                  %%mm4\n"
   1.495 -         "paddw          %%mm1,                  %%mm3\n" // Lum4 +red
   1.496 -         "packuswb       %%mm5,                  %%mm5\n"
   1.497 -         "paddw          %%mm2,                  %%mm0\n" // Lum4 +green
   1.498 -         "packuswb       %%mm6,                  %%mm6\n"
   1.499 -         "punpcklbw      %%mm4,                  %%mm4\n"
   1.500 -         "punpcklbw      %%mm5,                  %%mm5\n"
   1.501 -         "punpcklbw      %%mm6,                  %%mm6\n"
   1.502 -         "psllw          $3,                     %%mm5\n" // GREEN 3
   1.503 -         "pand           %16,                    %%mm4\n"
   1.504 -         "psraw          $6,                     %%mm3\n" // psr 6
   1.505 -         "psraw          $6,                     %%mm0\n"
   1.506 -         "pand           %16,                    %%mm6\n" // BLUE
   1.507 -         "pand           %17,                    %%mm5\n"
   1.508 -         "psrlw          $11,                    %%mm6\n" // BLUE  3
   1.509 -         "por            %%mm5,                  %%mm4\n"
   1.510 -         "psraw          $6,                     %%mm7\n"
   1.511 -         "por            %%mm6,                  %%mm4\n"
   1.512 -         "packuswb       %%mm3,                  %%mm3\n"
   1.513 -         "packuswb       %%mm0,                  %%mm0\n"
   1.514 -         "packuswb       %%mm7,                  %%mm7\n"
   1.515 -         "punpcklbw      %%mm3,                  %%mm3\n"
   1.516 -         "punpcklbw      %%mm0,                  %%mm0\n"
   1.517 -         "punpcklbw      %%mm7,                  %%mm7\n"
   1.518 -         "pand           %16,                    %%mm3\n"
   1.519 -         "pand           %16,                    %%mm7\n" // BLUE
   1.520 -         "psllw          $3,                     %%mm0\n" // GREEN 4
   1.521 -         "psrlw          $11,                    %%mm7\n"
   1.522 -         "pand           %17,                    %%mm0\n"
   1.523 -         "por            %%mm7,                  %%mm3\n"
   1.524 -         "por            %%mm0,                  %%mm3\n"
   1.525 +		"movq           %%mm4,                  %%mm5\n" // Lum3
   1.526 +		"paddw          %%mm1,                  %%mm4\n" // Lum3 +red
   1.527 +		"paddw          %%mm2,                  %%mm5\n" // Lum3 +green
   1.528 +		"psraw          $6,                     %%mm4\n"
   1.529 +		"movq           %%mm7,                  %%mm3\n" // Lum4
   1.530 +		"psraw          $6,                     %%mm5\n"
   1.531 +		"paddw          %%mm0,                  %%mm7\n" // Lum4 +blue
   1.532 +		"psraw          $6,                     %%mm6\n" // Lum3 +blue
   1.533 +		"movq           %%mm3,                  %%mm0\n" // Lum4
   1.534 +		"packuswb       %%mm4,                  %%mm4\n"
   1.535 +		"paddw          %%mm1,                  %%mm3\n" // Lum4 +red
   1.536 +		"packuswb       %%mm5,                  %%mm5\n"
   1.537 +		"paddw          %%mm2,                  %%mm0\n" // Lum4 +green
   1.538 +		"packuswb       %%mm6,                  %%mm6\n"
   1.539 +		"punpcklbw      %%mm4,                  %%mm4\n"
   1.540 +		"punpcklbw      %%mm5,                  %%mm5\n"
   1.541 +		"punpcklbw      %%mm6,                  %%mm6\n"
   1.542 +		"psllw          $3,                     %%mm5\n" // GREEN 3
   1.543 +		"pand           %16,                    %%mm4\n"
   1.544 +		"psraw          $6,                     %%mm3\n" // psr 6
   1.545 +		"psraw          $6,                     %%mm0\n"
   1.546 +		"pand           %16,                    %%mm6\n" // BLUE
   1.547 +		"pand           %17,                    %%mm5\n"
   1.548 +		"psrlw          $11,                    %%mm6\n" // BLUE  3
   1.549 +		"por            %%mm5,                  %%mm4\n"
   1.550 +		"psraw          $6,                     %%mm7\n"
   1.551 +		"por            %%mm6,                  %%mm4\n"
   1.552 +		"packuswb       %%mm3,                  %%mm3\n"
   1.553 +		"packuswb       %%mm0,                  %%mm0\n"
   1.554 +		"packuswb       %%mm7,                  %%mm7\n"
   1.555 +		"punpcklbw      %%mm3,                  %%mm3\n"
   1.556 +		"punpcklbw      %%mm0,                  %%mm0\n"
   1.557 +		"punpcklbw      %%mm7,                  %%mm7\n"
   1.558 +		"pand           %16,                    %%mm3\n"
   1.559 +		"pand           %16,                    %%mm7\n" // BLUE
   1.560 +		"psllw          $3,                     %%mm0\n" // GREEN 4
   1.561 +		"psrlw          $11,                    %%mm7\n"
   1.562 +		"pand           %17,                    %%mm0\n"
   1.563 +		"por            %%mm7,                  %%mm3\n"
   1.564 +		"por            %%mm0,                  %%mm3\n"
   1.565  
   1.566 -         "movq           %%mm4,                  %%mm5\n"
   1.567 +		"movq           %%mm4,                  %%mm5\n"
   1.568  
   1.569 -         "punpcklwd      %%mm3,                  %%mm4\n"
   1.570 -         "punpckhwd      %%mm3,                  %%mm5\n"
   1.571 +		"punpcklwd      %%mm3,                  %%mm4\n"
   1.572 +		"punpckhwd      %%mm3,                  %%mm5\n"
   1.573  
   1.574 -         "movq           %%mm4,                  (%5)\n"
   1.575 -         "movq           %%mm5,                  8(%5)\n"
   1.576 +		"movq           %%mm4,                  (%5)\n"
   1.577 +		"movq           %%mm5,                  8(%5)\n"
   1.578  
   1.579 -         "addl           $8,                     %6\n"
   1.580 -         "addl           $8,                     %2\n"
   1.581 -         "addl           $4,                     (%%esp)\n"
   1.582 -         "addl           $4,                     %1\n"
   1.583 -         "cmpl           %4,                     %6\n"
   1.584 -         "leal           16(%3),                 %3\n"
   1.585 -         "leal           16(%5),%5\n" // row2+16
   1.586 +		"addl           $8,                     %6\n"
   1.587 +		"addl           $8,                     %2\n"
   1.588 +		"addl           $4,                     (%%esp)\n"
   1.589 +		"addl           $4,                     %1\n"
   1.590 +		"cmpl           %4,                     %6\n"
   1.591 +		"leal           16(%3),                 %3\n"
   1.592 +		"leal           16(%5),%5\n" // row2+16
   1.593  
   1.594 -
   1.595 -         "jl             1b\n"
   1.596 -         "addl           %4,     %2\n" // lum += cols
   1.597 -         "addl           %8,     %3\n" // row1+= mod
   1.598 -         "addl           %8,     %5\n" // row2+= mod
   1.599 -         "movl           $0,     %6\n" // x=0
   1.600 -         "cmpl           %7,     %2\n"
   1.601 -         "jl             1b\n"
   1.602 -         "addl $4, %%esp\n"  // get rid of the stack slot we reserved.
   1.603 -         "emms\n"
   1.604 -         :
   1.605 -         : "m" (cr), "r"(cb),"r"(lum),
   1.606 -           "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
   1.607 -           "m"(MMX_0080w),"m"(MMX_Ugrn565),"m"(MMX_Ublu5x5),
   1.608 -           "m"(MMX_00FFw),"m"(MMX_Vgrn565),"m"(MMX_Vred5x5),
   1.609 -           "m"(MMX_Ycoeff),"m"(MMX_red565),"m"(MMX_grn565));
   1.610 +		"jl             1b\n"
   1.611 +		"addl           %4,     %2\n" // lum += cols
   1.612 +		"addl           %8,     %3\n" // row1+= mod
   1.613 +		"addl           %8,     %5\n" // row2+= mod
   1.614 +		"movl           $0,     %6\n" // x=0
   1.615 +		"cmpl           %7,     %2\n"
   1.616 +		"jl             1b\n"
   1.617 +		"addl $4, %%esp\n"  // get rid of the stack slot we reserved.
   1.618 +		"emms\n"
   1.619 +		:
   1.620 +		: "m" (cr), "r"(cb),"r"(lum),
   1.621 +		  "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
   1.622 +		  "m"(MMX_0080w),"m"(MMX_Ugrn565),"m"(MMX_Ublu5x5),
   1.623 +		  "m"(MMX_00FFw),"m"(MMX_Vgrn565),"m"(MMX_Vred5x5),
   1.624 +		  "m"(MMX_Ycoeff),"m"(MMX_red565),"m"(MMX_grn565)
   1.625 +	);
   1.626  }
   1.627  
   1.628  #endif /* GCC3 i386 inline assembly */