[MPlayer-dev-eng] Invalid asm constructs in swscale.c

Fredrik Kuivinen freku045 at student.liu.se
Mon Nov 5 23:54:50 CET 2001


Hello,

I got the following error when compiling the mplayer cvs with gcc 2.95.4:

gcc -c -W -Wall -O2 -march=i686 -mcpu=i686 -g -p -D_REENTRANT -I. -I.. -Wall -o swscale.o swscale.c
swscale.c: In function `SwScale_YV12slice':
swscale.c:1447: warning: comparison between signed and unsigned
swscale.c:749: Invalid `asm' statement:
swscale.c:749: fixed or forbidden register 0 (ax) was spilled for class GENERAL_REGS.
make[1]: *** [swscale.o] Error 1

There are three similiar errors in swscale.c. The attached patch fixes these
errors.

/ Fredrik Kuivinen

-------------- next part --------------
--- /home/ksorim/mplayer/mplayercvs-old/main/postproc/swscale.c	Mon Nov  5 23:21:11 2001
+++ swscale.c	Mon Nov  5 23:42:51 2001
@@ -739,13 +739,14 @@
 		}
 		else if(dstbpp==24)
 		{
+			int dummy1, dummy2;
 			asm volatile(
 				YSCALEYUV2RGB
 				WRITEBGR24
 
-			:: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "r" (dest), "m" (dstw),
+			: "=a" (dummy1), "=b" (dummy2)
+			: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "r" (dest), "m" (dstw),
 			"m" (yalpha1), "m" (uvalpha1)
-			: "%eax", "%ebx"
 			);
 		}
 		else if(dstbpp==15)
@@ -921,12 +922,13 @@
 		}
 		else if(dstbpp==24)
 		{
+			int dummy1, dummy2;
 			asm volatile(
 				YSCALEYUV2RGB1
 				WRITEBGR24
-			:: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "r" (dest), "m" (dstw),
+			: "=a" (dummy1), "=b" (dummy2)
+			: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "r" (dest), "m" (dstw),
 			"m" (yalpha1), "m" (uvalpha1)
-			: "%eax", "%ebx"
 			);
 		}
 		else if(dstbpp==15)
@@ -977,12 +979,13 @@
 		}
 		else if(dstbpp==24)
 		{
+			int dummy1, dummy2;
 			asm volatile(
 				YSCALEYUV2RGB1b
 				WRITEBGR24
-			:: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "r" (dest), "m" (dstw),
+			: "=a" (dummy1), "=b" (dummy2)
+			: "r" (buf0), "r" (buf1), "r" (uvbuf0), "r" (uvbuf1), "r" (dest), "m" (dstw),
 			"m" (yalpha1), "m" (uvalpha1)
-			: "%eax", "%ebx"
 			);
 		}
 		else if(dstbpp==15)


More information about the MPlayer-dev-eng mailing list