[MPlayer-cvslog] CVS: main/postproc swscale_template.c,1.124,1.125
Michael Niedermayer CVS
syncmail at mplayerhq.hu
Sat May 6 04:01:42 CEST 2006
CVS change done by Michael Niedermayer CVS
Update of /cvsroot/mplayer/main/postproc
In directory mail:/var2/tmp/cvs-serv9746
Modified Files:
swscale_template.c
Log Message:
removing esp usage
this is certainly not the most beautifull but it should work without -fomit-frame-pointer and PIC and gcc-4 vomits when ebp is given in a constraint directly even with -fomi-frame-pointer so theres not that much choice ...
if anyone knows a simpler/cleaner solution, dont hesitate to suggest it ...
Index: swscale_template.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/swscale_template.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -r1.124 -r1.125
--- swscale_template.c 15 Apr 2006 20:46:54 -0000 1.124
+++ swscale_template.c 6 May 2006 02:01:39 -0000 1.125
@@ -1218,34 +1218,37 @@
//Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
case IMGFMT_BGR32:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2RGB(%%REGa, %5)
- WRITEBGR32(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
-
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2RGB(%%REGBP, %5)
+ WRITEBGR32(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
+
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
case IMGFMT_BGR24:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2RGB(%%REGa, %5)
- WRITEBGR24(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2RGB(%%REGBP, %5)
+ WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
case IMGFMT_BGR15:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2RGB(%%REGa, %5)
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2RGB(%%REGBP, %5)
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2\n\t"
@@ -1253,19 +1256,20 @@
"paddusb "MANGLE(r5Dither)", %%mm5\n\t"
#endif
- WRITEBGR15(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
+ WRITEBGR15(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
case IMGFMT_BGR16:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2RGB(%%REGa, %5)
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2RGB(%%REGBP, %5)
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2\n\t"
@@ -1273,23 +1277,24 @@
"paddusb "MANGLE(r5Dither)", %%mm5\n\t"
#endif
- WRITEBGR16(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ WRITEBGR16(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
case IMGFMT_YUY2:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2PACKED(%%REGa, %5)
- WRITEYUY2(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2PACKED(%%REGBP, %5)
+ WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
default: break;
@@ -1323,54 +1328,58 @@
{
case IMGFMT_BGR32:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2RGB1(%%REGa, %5)
- WRITEBGR32(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
-
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2RGB1(%%REGBP, %5)
+ WRITEBGR32(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
+
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
case IMGFMT_BGR24:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2RGB1(%%REGa, %5)
- WRITEBGR24(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
-
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2RGB1(%%REGBP, %5)
+ WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
+
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
case IMGFMT_BGR15:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2RGB1(%%REGa, %5)
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2RGB1(%%REGBP, %5)
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2\n\t"
"paddusb "MANGLE(g5Dither)", %%mm4\n\t"
"paddusb "MANGLE(r5Dither)", %%mm5\n\t"
#endif
- WRITEBGR15(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
+ WRITEBGR15(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
case IMGFMT_BGR16:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2RGB1(%%REGa, %5)
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2RGB1(%%REGBP, %5)
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2\n\t"
@@ -1378,25 +1387,26 @@
"paddusb "MANGLE(r5Dither)", %%mm5\n\t"
#endif
- WRITEBGR16(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
+ WRITEBGR16(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
case IMGFMT_YUY2:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2PACKED1(%%REGa, %5)
- WRITEYUY2(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
-
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2PACKED1(%%REGBP, %5)
+ WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
+
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
}
@@ -1407,54 +1417,58 @@
{
case IMGFMT_BGR32:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2RGB1b(%%REGa, %5)
- WRITEBGR32(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
-
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2RGB1b(%%REGBP, %5)
+ WRITEBGR32(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
+
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
case IMGFMT_BGR24:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2RGB1b(%%REGa, %5)
- WRITEBGR24(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
-
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2RGB1b(%%REGBP, %5)
+ WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
+
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
case IMGFMT_BGR15:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2RGB1b(%%REGa, %5)
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2RGB1b(%%REGBP, %5)
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2\n\t"
"paddusb "MANGLE(g5Dither)", %%mm4\n\t"
"paddusb "MANGLE(r5Dither)", %%mm5\n\t"
#endif
- WRITEBGR15(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
+ WRITEBGR15(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
case IMGFMT_BGR16:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2RGB1b(%%REGa, %5)
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2RGB1b(%%REGBP, %5)
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2\n\t"
@@ -1462,25 +1476,26 @@
"paddusb "MANGLE(r5Dither)", %%mm5\n\t"
#endif
- WRITEBGR16(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
+ WRITEBGR16(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
case IMGFMT_YUY2:
asm volatile(
- "mov %%"REG_SP", "ESP_OFFSET"(%5) \n\t"
- "mov %4, %%"REG_SP" \n\t"
- YSCALEYUV2PACKED1b(%%REGa, %5)
- WRITEYUY2(%%REGSP, 8280(%5), %%REGa)
- "mov "ESP_OFFSET"(%5), %%"REG_SP" \n\t"
-
- :: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "m" (dest),
- "r" (&c->redDither)
- : "%"REG_a
+ "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
+ "mov %4, %%"REG_b" \n\t"
+ "push %%"REG_BP" \n\t"
+ YSCALEYUV2PACKED1b(%%REGBP, %5)
+ WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
+ "pop %%"REG_BP" \n\t"
+ "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
+
+ :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
+ "a" (&c->redDither)
);
return;
}
More information about the MPlayer-cvslog
mailing list