[MPlayer-dev-eng] [PATCH] Maybe annoing but I would be happy to test compiles with gcc 4.1 cvs on x86

Gianluigi Tiesi mplayer at netfarm.it
Thu Jun 2 06:56:07 CEST 2005


Similar fix has been adapted in most of the code like
postprocess_template.c, so someone could take a look at this
code if it's correct? I've made it human readable.

Bye
-- 
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/
-------------- next part --------------
Index: mmx.h
===================================================================
RCS file: /cvsroot/mplayer/main/mmx.h,v
retrieving revision 1.1
diff -u -r1.1 mmx.h
--- mmx.h	28 Oct 2001 11:47:21 -0000	1.1
+++ mmx.h	2 Jun 2005 04:37:10 -0000
@@ -353,7 +353,7 @@
 #define	mmx_m2r(op, mem, reg) \
 	__asm__ __volatile__ (#op " %0, %%" #reg \
 			      : /* nothing */ \
-			      : "X" (mem))
+			      : "m" (mem))
 
 #define	mmx_r2m(op, reg, mem) \
 	__asm__ __volatile__ (#op " %%" #reg ", %0" \
Index: liba52/imdct.c
===================================================================
RCS file: /cvsroot/mplayer/main/liba52/imdct.c,v
retrieving revision 1.26
diff -u -r1.26 imdct.c
--- liba52/imdct.c	22 Mar 2005 23:27:18 -0000	1.26
+++ liba52/imdct.c	2 Jun 2005 04:37:10 -0000
@@ -770,6 +770,8 @@
     int m;
     int two_m;
     int two_m_plus_one;
+    int two_m_plus_one_shl3;
+    complex_t *buf_offset;
 
 /*  sample_t tmp_a_i;
     sample_t tmp_a_r;
@@ -938,6 +940,8 @@
     for (m=3; m < 7; m++) {
 	two_m = (1 << m);
 	two_m_plus_one = two_m<<1;
+	two_m_plus_one_shl3 = (two_m_plus_one<<3);
+	buf_offset = buf+128;
 	asm volatile(
 		"movl %0, %%esi				\n\t"
 		".balign 16				\n\t"
@@ -963,7 +967,7 @@
 		"addl %2, %%esi				\n\t"
 		"cmpl %1, %%esi				\n\t"
 		" jb 1b					\n\t"
-		:: "g" (buf), "m" (buf+128), "m" (two_m_plus_one<<3), "r" (two_m<<3),
+		:: "g" (buf), "m" (buf_offset), "m" (two_m_plus_one_shl3), "r" (two_m<<3),
 		   "r" (sseW[m])
 		: "%esi", "%edi", "%edx"
 	);
Index: postproc/swscale_template.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/swscale_template.c,v
retrieving revision 1.113
diff -u -r1.113 swscale_template.c
--- postproc/swscale_template.c	29 Apr 2005 18:32:24 -0000	1.113
+++ postproc/swscale_template.c	2 Jun 2005 04:37:11 -0000
@@ -2129,6 +2129,7 @@
 	}
 	else
 	{
+		uint8_t *offset = src+filterSize;
 		long counter= -2*dstW;
 //		filter-= counter*filterSize/2;
 		filterPos-= counter/2;
@@ -2171,7 +2172,7 @@
 			" jnc 1b			\n\t"
 
 			: "+r" (counter), "+r" (filter)
-			: "m" (filterPos), "m" (dst), "m"(src+filterSize),
+			: "m" (filterPos), "m" (dst), "m"(offset),
 			  "m" (src), "r" ((long)filterSize*2)
 			: "%"REG_b, "%"REG_a, "%"REG_c
 		);
@@ -2313,6 +2314,8 @@
 	else
 	{
 #endif
+	int xInc_shr16 = xInc >> 16;
+	int xInc_mask = xInc & 0xffff;
 	//NO MMX just normal asm ...
 	asm volatile(
 		"xor %%"REG_a", %%"REG_a"	\n\t" // i
@@ -2350,7 +2353,7 @@
 		" jb 1b				\n\t"
 
 
-		:: "r" (src), "m" (dst), "m" (dstWidth), "m" (xInc>>16), "m" (xInc&0xFFFF)
+		:: "r" (src), "m" (dst), "m" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask)
 		: "%"REG_a, "%"REG_b, "%ecx", "%"REG_D, "%esi"
 		);
 #ifdef HAVE_MMX2
@@ -2509,6 +2512,8 @@
 	else
 	{
 #endif
+	long xInc_shr16 = (long) (xInc >> 16);
+	int xInc_mask = xInc & 0xffff; 
 	asm volatile(
 		"xor %%"REG_a", %%"REG_a"	\n\t" // i
 		"xor %%"REG_b", %%"REG_b"		\n\t" // xx
@@ -2542,7 +2547,7 @@
 		"cmp %2, %%"REG_a"		\n\t"
 		" jb 1b				\n\t"
 
-		:: "m" (src1), "m" (dst), "m" ((long)dstWidth), "m" ((long)(xInc>>16)), "m" ((xInc&0xFFFF)),
+		:: "m" (src1), "m" (dst), "m" ((long)dstWidth), "m" (xInc_shr16), "m" (xInc_mask),
 		"r" (src2)
 		: "%"REG_a, "%"REG_b, "%ecx", "%"REG_D, "%esi"
 		);


More information about the MPlayer-dev-eng mailing list