[Mplayer-cvslog] CVS: main/libmpcodecs pullup.c, 1.19, 1.20 vf_decimate.c, 1.1, 1.2 vf_divtc.c, 1.1, 1.2 vf_eq.c, 1.7, 1.8 vf_eq2.c, 1.8, 1.9 vf_filmdint.c, 1.3, 1.4 vf_halfpack.c, 1.5, 1.6 vf_ilpack.c, 1.4, 1.5 vf_ivtc.c, 1.3, 1.4 vf_noise.c, 1.13, 1.14 vf_spp.c, 1.23, 1.24 vf_tfields.c, 1.7, 1.8

Aurelien Jacobs CVS syncmail at mplayerhq.hu
Thu Oct 21 13:55:23 CEST 2004


CVS change done by Aurelien Jacobs CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv9471/libmpcodecs

Modified Files:
	pullup.c vf_decimate.c vf_divtc.c vf_eq.c vf_eq2.c 
	vf_filmdint.c vf_halfpack.c vf_ilpack.c vf_ivtc.c vf_noise.c 
	vf_spp.c vf_tfields.c 
Log Message:
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64

Index: pullup.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/pullup.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- pullup.c	3 Sep 2004 00:08:58 -0000	1.19
+++ pullup.c	21 Oct 2004 11:55:19 -0000	1.20
@@ -8,6 +8,7 @@
 
 
 
+#ifdef ARCH_X86
 #ifdef HAVE_MMX
 static int diff_y_mmx(unsigned char *a, unsigned char *b, int s)
 {
@@ -147,6 +148,7 @@
 	return ret;
 }
 #endif
+#endif
 
 #define ABS(a) (((a)^((a)>>31))-((a)>>31))
 
@@ -682,12 +684,14 @@
 	case PULLUP_FMT_Y:
 		c->diff = diff_y;
 		c->comb = licomb_y;
+#ifdef ARCH_X86
 #ifdef HAVE_MMX
 		if (c->cpu & PULLUP_CPU_MMX) {
 			c->diff = diff_y_mmx;
 			c->comb = licomb_y_mmx;
 		}
 #endif
+#endif
 		/* c->comb = qpcomb_y; */
 		break;
 #if 0

Index: vf_decimate.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_decimate.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vf_decimate.c	22 May 2003 12:38:42 -0000	1.1
+++ vf_decimate.c	21 Oct 2004 11:55:19 -0000	1.2
@@ -31,11 +31,11 @@
 		".balign 16 \n\t"
 		"1: \n\t"
 		
-		"movq (%%esi), %%mm0 \n\t"
-		"movq (%%esi), %%mm2 \n\t"
-		"addl %%eax, %%esi \n\t"
-		"movq (%%edi), %%mm1 \n\t"
-		"addl %%ebx, %%edi \n\t"
+		"movq (%%"REG_S"), %%mm0 \n\t"
+		"movq (%%"REG_S"), %%mm2 \n\t"
+		"add %%"REG_a", %%"REG_S" \n\t"
+		"movq (%%"REG_D"), %%mm1 \n\t"
+		"add %%"REG_b", %%"REG_D" \n\t"
 		"psubusb %%mm1, %%mm2 \n\t"
 		"psubusb %%mm0, %%mm1 \n\t"
 		"movq %%mm2, %%mm0 \n\t"
@@ -51,10 +51,10 @@
 		
 		"decl %%ecx \n\t"
 		"jnz 1b \n\t"
-		"movq %%mm4, (%%edx) \n\t"
+		"movq %%mm4, (%%"REG_d") \n\t"
 		"emms \n\t"
 		: 
-		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
+		: "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
 		: "memory"
 		);
 	return out[0]+out[1]+out[2]+out[3];

Index: vf_divtc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_divtc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vf_divtc.c	17 Apr 2004 17:08:30 -0000	1.1
+++ vf_divtc.c	21 Oct 2004 11:55:19 -0000	1.2
@@ -44,11 +44,11 @@
 	".balign 16 \n\t"
 	"1: \n\t"
 
-	"movq (%%esi), %%mm0 \n\t"
-	"movq (%%esi), %%mm2 \n\t"
-	"addl %%eax, %%esi \n\t"
-	"movq (%%edi), %%mm1 \n\t"
-	"addl %%ebx, %%edi \n\t"
+	"movq (%%"REG_S"), %%mm0 \n\t"
+	"movq (%%"REG_S"), %%mm2 \n\t"
+	"add %%"REG_a", %%"REG_S" \n\t"
+	"movq (%%"REG_D"), %%mm1 \n\t"
+	"add %%"REG_b", %%"REG_D" \n\t"
 	"psubusb %%mm1, %%mm2 \n\t"
 	"psubusb %%mm0, %%mm1 \n\t"
 	"movq %%mm2, %%mm0 \n\t"
@@ -64,10 +64,10 @@
 
 	"decl %%ecx \n\t"
 	"jnz 1b \n\t"
-	"movq %%mm4, (%%edx) \n\t"
+	"movq %%mm4, (%%"REG_d") \n\t"
 	"emms \n\t"
 	:
-	: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
+	: "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
 	: "memory"
 	);
    return out[0]+out[1]+out[2]+out[3];

Index: vf_eq.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_eq.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- vf_eq.c	15 Mar 2003 20:45:03 -0000	1.7
+++ vf_eq.c	21 Oct 2004 11:55:19 -0000	1.8
@@ -64,9 +64,9 @@
 			"paddw %%mm3, %%mm1 \n\t"
 			"paddw %%mm3, %%mm2 \n\t"
 			"packuswb %%mm2, %%mm1 \n\t"
-			"addl $8, %0 \n\t"
+			"add $8, %0 \n\t"
 			"movq %%mm1, (%1) \n\t"
-			"addl $8, %1 \n\t"
+			"add $8, %1 \n\t"
 			"decl %%eax \n\t"
 			"jnz 1b \n\t"
 			: "=r" (src), "=r" (dest)

Index: vf_eq2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_eq2.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- vf_eq2.c	18 Oct 2003 23:02:30 -0000	1.8
+++ vf_eq2.c	21 Oct 2004 11:55:19 -0000	1.9
@@ -152,9 +152,9 @@
       "paddw %%mm3, %%mm1 \n\t"
       "paddw %%mm3, %%mm2 \n\t"
       "packuswb %%mm2, %%mm1 \n\t"
-      "addl $8, %0 \n\t"
+      "add $8, %0 \n\t"
       "movq %%mm1, (%1) \n\t"
-      "addl $8, %1 \n\t"
+      "add $8, %1 \n\t"
       "decl %%eax \n\t"
       "jnz 1b \n\t"
       : "=r" (src), "=r" (dst)

Index: vf_filmdint.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_filmdint.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vf_filmdint.c	23 Apr 2004 01:37:43 -0000	1.3
+++ vf_filmdint.c	21 Oct 2004 11:55:19 -0000	1.4
@@ -406,8 +406,8 @@
 	    "psllq $16, %%mm0\n\t"					     \
 	    "paddusw %%mm0, %%mm7\n\t"					     \
 	    "movq (%1), %%mm4\n\t"					     \
-	    "leal (%0,%2,2), %0\n\t"					     \
-	    "leal (%1,%3,2), %1\n\t"					     \
+	    "lea (%0,%2,2), %0\n\t"					     \
+	    "lea (%1,%3,2), %1\n\t"					     \
 	    "psubusb %4, %%mm4\n\t"					     \
 	    PAVGB(%%mm2, %%mm4)						     \
 	    PAVGB(%%mm2, %%mm4)    /* mm4 = qup odd */			     \
@@ -440,7 +440,7 @@
 	    "paddusw %%mm2, %%mm7\n\t"					     \
 	    "paddusw %%mm1, %%mm7\n\t"					     \
 	    : "=r" (a), "=r" (b)					     \
-	    : "r"(as), "r"(bs), "m" (ones), "0"(a), "1"(b), "X"(*a), "X"(*b) \
+	    : "r"((long)as), "r"((long)bs), "m" (ones), "0"(a), "1"(b), "X"(*a), "X"(*b) \
 	    );								     \
     } while (--lines);
 
@@ -650,7 +650,7 @@
 	    "por %%mm3, %%mm1 \n\t"     /* avg if >= threshold */
 	    "movq %%mm1, (%2,%4) \n\t"
 	    : /* no output */
-	    : "r" (a), "r" (bos), "r" (dst), "r" (ss), "r" (ds), "r" (cos)
+	    : "r" (a), "r" (bos), "r" (dst), "r" ((long)ss), "r" ((long)ds), "r" (cos)
 	    );
 	a += 8;
 	dst += 8;

Index: vf_halfpack.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_halfpack.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vf_halfpack.c	15 Mar 2003 18:01:02 -0000	1.5
+++ vf_halfpack.c	21 Oct 2004 11:55:19 -0000	1.6
@@ -75,13 +75,13 @@
 			"por %%mm5, %%mm1 \n\t"
 			"por %%mm6, %%mm2 \n\t"
 
-			"addl $8, %0 \n\t"
-			"addl $8, %1 \n\t"
-			"addl $4, %2 \n\t"
-			"addl $4, %3 \n\t"
+			"add $8, %0 \n\t"
+			"add $8, %1 \n\t"
+			"add $4, %2 \n\t"
+			"add $4, %3 \n\t"
 			"movq %%mm1, (%8) \n\t"
 			"movq %%mm2, 8(%8) \n\t"
-			"addl $16, %8 \n\t"
+			"add $16, %8 \n\t"
 			"decl %9 \n\t"
 			"jnz 1b \n\t"
 			: "=r" (y1), "=r" (y2), "=r" (u), "=r" (v)

Index: vf_ilpack.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_ilpack.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vf_ilpack.c	15 Dec 2003 14:29:09 -0000	1.4
+++ vf_ilpack.c	21 Oct 2004 11:55:19 -0000	1.5
@@ -76,12 +76,12 @@
 		"punpcklbw %%mm4, %%mm1 \n\t"
 		"punpckhbw %%mm4, %%mm2 \n\t"
 		
-		"addl $8, %0 \n\t"
-		"addl $4, %1 \n\t"
-		"addl $4, %2 \n\t"
+		"add $8, %0 \n\t"
+		"add $4, %1 \n\t"
+		"add $4, %2 \n\t"
 		"movq %%mm1, (%3) \n\t"
 		"movq %%mm2, 8(%3) \n\t"
-		"addl $16, %3 \n\t"
+		"add $16, %3 \n\t"
 		"decl %4 \n\t"
 		"jnz 1b \n\t"
 		"emms \n\t"
@@ -96,22 +96,26 @@
 	unsigned char *u, unsigned char *v, int w, int us, int vs)
 {
 	asm volatile (""
-		"pushl %%ebp \n\t"
-		"movl 4(%%edx), %%ebp \n\t"
-		"movl (%%edx), %%edx \n\t"
+		"push %%"REG_BP" \n\t"
+#ifdef ARCH_X86_64
+		"mov %6, %%"REG_BP" \n\t"
+#else
+		"movl 4(%%"REG_d"), %%"REG_BP" \n\t"
+		"movl (%%"REG_d"), %%"REG_d" \n\t"
+#endif
 		"pxor %%mm0, %%mm0 \n\t"
 		
 		".balign 16 \n\t"
 		".Lli0: \n\t"
-		"movq (%%esi), %%mm1 \n\t"
-		"movq (%%esi), %%mm2 \n\t"
+		"movq (%%"REG_S"), %%mm1 \n\t"
+		"movq (%%"REG_S"), %%mm2 \n\t"
 		
-		"movq (%%eax,%%edx,2), %%mm4 \n\t"
-		"movq (%%ebx,%%ebp,2), %%mm6 \n\t"
+		"movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t"
+		"movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t"
 		"punpcklbw %%mm0, %%mm4 \n\t"
 		"punpcklbw %%mm0, %%mm6 \n\t"
-		"movq (%%eax), %%mm3 \n\t"
-		"movq (%%ebx), %%mm5 \n\t"
+		"movq (%%"REG_a"), %%mm3 \n\t"
+		"movq (%%"REG_b"), %%mm5 \n\t"
 		"punpcklbw %%mm0, %%mm3 \n\t"
 		"punpcklbw %%mm0, %%mm5 \n\t"
 		"paddw %%mm3, %%mm4 \n\t"
@@ -136,18 +140,18 @@
 		"punpcklbw %%mm4, %%mm1 \n\t"
 		"punpckhbw %%mm4, %%mm2 \n\t"
 		
-		"movq %%mm1, (%%edi) \n\t"
-		"movq %%mm2, 8(%%edi) \n\t"
+		"movq %%mm1, (%%"REG_D") \n\t"
+		"movq %%mm2, 8(%%"REG_D") \n\t"
 		
-		"movq 8(%%esi), %%mm1 \n\t"
-		"movq 8(%%esi), %%mm2 \n\t"
+		"movq 8(%%"REG_S"), %%mm1 \n\t"
+		"movq 8(%%"REG_S"), %%mm2 \n\t"
 		
-		"movq (%%eax,%%edx,2), %%mm4 \n\t"
-		"movq (%%ebx,%%ebp,2), %%mm6 \n\t"
+		"movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t"
+		"movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t"
 		"punpckhbw %%mm0, %%mm4 \n\t"
 		"punpckhbw %%mm0, %%mm6 \n\t"
-		"movq (%%eax), %%mm3 \n\t"
-		"movq (%%ebx), %%mm5 \n\t"
+		"movq (%%"REG_a"), %%mm3 \n\t"
+		"movq (%%"REG_b"), %%mm5 \n\t"
 		"punpckhbw %%mm0, %%mm3 \n\t"
 		"punpckhbw %%mm0, %%mm5 \n\t"
 		"paddw %%mm3, %%mm4 \n\t"
@@ -172,20 +176,25 @@
 		"punpcklbw %%mm4, %%mm1 \n\t"
 		"punpckhbw %%mm4, %%mm2 \n\t"
 		
-		"addl $16, %%esi \n\t"
-		"addl $8, %%eax \n\t"
-		"addl $8, %%ebx \n\t"
-		
-		"movq %%mm1, 16(%%edi) \n\t"
-		"movq %%mm2, 24(%%edi) \n\t"
-		"addl $32, %%edi \n\t"
+		"add $16, %%"REG_S" \n\t"
+		"add $8, %%"REG_a" \n\t"
+		"add $8, %%"REG_b" \n\t"
+		
+		"movq %%mm1, 16(%%"REG_D") \n\t"
+		"movq %%mm2, 24(%%"REG_D") \n\t"
+		"add $32, %%"REG_D" \n\t"
 		
 		"decl %%ecx \n\t"
 		"jnz .Lli0 \n\t"
 		"emms \n\t"
-		"popl %%ebp \n\t"
+		"pop %%"REG_BP" \n\t"
 		: 
-		: "S" (y), "D" (dst), "a" (u), "b" (v), "d" (&us), "c" (w/16)
+		: "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16),
+#ifdef ARCH_X86_64
+		"d" ((long)us), "r" ((long)vs)
+#else
+		"d" (&us)
+#endif
 		: "memory"
 		);
 	pack_li_0_C(dst, y, u, v, (w&15), us, vs);
@@ -195,22 +204,26 @@
 	unsigned char *u, unsigned char *v, int w, int us, int vs)
 {
 	asm volatile (""
-		"pushl %%ebp \n\t"
-		"movl 4(%%edx), %%ebp \n\t"
-		"movl (%%edx), %%edx \n\t"
+		"push %%"REG_BP" \n\t"
+#ifdef ARCH_X86_64
+		"mov %6, %%"REG_BP" \n\t"
+#else
+		"movl 4(%%"REG_d"), %%"REG_BP" \n\t"
+		"movl (%%"REG_d"), %%"REG_d" \n\t"
+#endif
 		"pxor %%mm0, %%mm0 \n\t"
 		
 		".balign 16 \n\t"
 		".Lli1: \n\t"
-		"movq (%%esi), %%mm1 \n\t"
-		"movq (%%esi), %%mm2 \n\t"
+		"movq (%%"REG_S"), %%mm1 \n\t"
+		"movq (%%"REG_S"), %%mm2 \n\t"
 		
-		"movq (%%eax,%%edx,2), %%mm4 \n\t"
-		"movq (%%ebx,%%ebp,2), %%mm6 \n\t"
+		"movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t"
+		"movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t"
 		"punpcklbw %%mm0, %%mm4 \n\t"
 		"punpcklbw %%mm0, %%mm6 \n\t"
-		"movq (%%eax), %%mm3 \n\t"
-		"movq (%%ebx), %%mm5 \n\t"
+		"movq (%%"REG_a"), %%mm3 \n\t"
+		"movq (%%"REG_b"), %%mm5 \n\t"
 		"punpcklbw %%mm0, %%mm3 \n\t"
 		"punpcklbw %%mm0, %%mm5 \n\t"
 		"movq %%mm4, %%mm7 \n\t"
@@ -237,18 +250,18 @@
 		"punpcklbw %%mm4, %%mm1 \n\t"
 		"punpckhbw %%mm4, %%mm2 \n\t"
 		
-		"movq %%mm1, (%%edi) \n\t"
-		"movq %%mm2, 8(%%edi) \n\t"
+		"movq %%mm1, (%%"REG_D") \n\t"
+		"movq %%mm2, 8(%%"REG_D") \n\t"
 		
-		"movq 8(%%esi), %%mm1 \n\t"
-		"movq 8(%%esi), %%mm2 \n\t"
+		"movq 8(%%"REG_S"), %%mm1 \n\t"
+		"movq 8(%%"REG_S"), %%mm2 \n\t"
 		
-		"movq (%%eax,%%edx,2), %%mm4 \n\t"
-		"movq (%%ebx,%%ebp,2), %%mm6 \n\t"
+		"movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t"
+		"movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t"
 		"punpckhbw %%mm0, %%mm4 \n\t"
 		"punpckhbw %%mm0, %%mm6 \n\t"
-		"movq (%%eax), %%mm3 \n\t"
-		"movq (%%ebx), %%mm5 \n\t"
+		"movq (%%"REG_a"), %%mm3 \n\t"
+		"movq (%%"REG_b"), %%mm5 \n\t"
 		"punpckhbw %%mm0, %%mm3 \n\t"
 		"punpckhbw %%mm0, %%mm5 \n\t"
 		"movq %%mm4, %%mm7 \n\t"
@@ -275,20 +288,25 @@
 		"punpcklbw %%mm4, %%mm1 \n\t"
 		"punpckhbw %%mm4, %%mm2 \n\t"
 		
-		"addl $16, %%esi \n\t"
-		"addl $8, %%eax \n\t"
-		"addl $8, %%ebx \n\t"
-		
-		"movq %%mm1, 16(%%edi) \n\t"
-		"movq %%mm2, 24(%%edi) \n\t"
-		"addl $32, %%edi \n\t"
+		"add $16, %%"REG_S" \n\t"
+		"add $8, %%"REG_a" \n\t"
+		"add $8, %%"REG_b" \n\t"
+		
+		"movq %%mm1, 16(%%"REG_D") \n\t"
+		"movq %%mm2, 24(%%"REG_D") \n\t"
+		"add $32, %%"REG_D" \n\t"
 		
 		"decl %%ecx \n\t"
 		"jnz .Lli1 \n\t"
 		"emms \n\t"
-		"popl %%ebp \n\t"
+		"pop %%"REG_BP" \n\t"
 		: 
-		: "S" (y), "D" (dst), "a" (u), "b" (v), "d" (&us), "c" (w/16)
+		: "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16),
+#ifdef ARCH_X86_64
+		"d" ((long)us), "r" ((long)vs)
+#else
+		"d" (&us)
+#endif
 		: "memory"
 		);
 	pack_li_1_C(dst, y, u, v, (w&15), us, vs);

Index: vf_ivtc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_ivtc.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vf_ivtc.c	26 Apr 2003 18:31:08 -0000	1.3
+++ vf_ivtc.c	21 Oct 2004 11:55:19 -0000	1.4
@@ -71,11 +71,11 @@
 		"1: \n\t"
 		
 		// Even difference
-		"movq (%%esi), %%mm0 \n\t"
-		"movq (%%esi), %%mm2 \n\t"
-		"addl %%eax, %%esi \n\t"
-		"movq (%%edi), %%mm1 \n\t"
-		"addl %%ebx, %%edi \n\t"
+		"movq (%%"REG_S"), %%mm0 \n\t"
+		"movq (%%"REG_S"), %%mm2 \n\t"
+		"add %%"REG_a", %%"REG_S" \n\t"
+		"movq (%%"REG_D"), %%mm1 \n\t"
+		"add %%"REG_b", %%"REG_D" \n\t"
 		"psubusb %%mm1, %%mm2 \n\t"
 		"psubusb %%mm0, %%mm1 \n\t"
 		"movq %%mm2, %%mm0 \n\t"
@@ -90,11 +90,11 @@
 		"paddw %%mm3, %%mm4 \n\t"
 		
 		// Odd difference
-		"movq (%%esi), %%mm0 \n\t"
-		"movq (%%esi), %%mm2 \n\t"
-		"addl %%eax, %%esi \n\t"
-		"movq (%%edi), %%mm1 \n\t"
-		"addl %%ebx, %%edi \n\t"
+		"movq (%%"REG_S"), %%mm0 \n\t"
+		"movq (%%"REG_S"), %%mm2 \n\t"
+		"add %%"REG_a", %%"REG_S" \n\t"
+		"movq (%%"REG_D"), %%mm1 \n\t"
+		"add %%"REG_b", %%"REG_D" \n\t"
 		"psubusb %%mm1, %%mm2 \n\t"
 		"psubusb %%mm0, %%mm1 \n\t"
 		"movq %%mm2, %%mm0 \n\t"
@@ -110,8 +110,8 @@
 			
 		"decl %%ecx \n\t"
 		"jnz 1b \n\t"
-		"movq %%mm4, (%%edx) \n\t"
-		"movq %%mm5, 8(%%edx) \n\t"
+		"movq %%mm4, (%%"REG_d") \n\t"
+		"movq %%mm5, 8(%%"REG_d") \n\t"
 		: 
 		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
 		: "memory"
@@ -130,14 +130,14 @@
 		".balign 16 \n\t"
 		"2: \n\t"
 		
-		"movq (%%esi), %%mm0 \n\t"
-		"movq (%%esi,%%eax), %%mm1 \n\t"
-		"addl %%eax, %%esi \n\t"
-		"addl %%eax, %%esi \n\t"
-		"movq (%%edi), %%mm2 \n\t"
-		"movq (%%edi,%%ebx), %%mm3 \n\t"
-		"addl %%ebx, %%edi \n\t"
-		"addl %%ebx, %%edi \n\t"
+		"movq (%%"REG_S"), %%mm0 \n\t"
+		"movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
+		"add %%"REG_a", %%"REG_S" \n\t"
+		"add %%"REG_a", %%"REG_S" \n\t"
+		"movq (%%"REG_D"), %%mm2 \n\t"
+		"movq (%%"REG_D",%%"REG_b"), %%mm3 \n\t"
+		"add %%"REG_b", %%"REG_D" \n\t"
+		"add %%"REG_b", %%"REG_D" \n\t"
 		"punpcklbw %%mm7, %%mm0 \n\t"
 		"punpcklbw %%mm7, %%mm1 \n\t"
 		"punpcklbw %%mm7, %%mm2 \n\t"
@@ -164,16 +164,16 @@
 		"psubw %%mm1, %%mm4 \n\t"
 		"psubw %%mm2, %%mm5 \n\t"
 		"psubw %%mm3, %%mm6 \n\t"
-		"movq %%mm4, (%%edx) \n\t"
-		"movq %%mm5, 16(%%edx) \n\t"
-		"movq %%mm6, 32(%%edx) \n\t"
-
-		"movl %%eax, %%ecx \n\t"
-		"shll $3, %%ecx \n\t"
-		"subl %%ecx, %%esi \n\t"
-		"movl %%ebx, %%ecx \n\t"
-		"shll $3, %%ecx \n\t"
-		"subl %%ecx, %%edi \n\t"
+		"movq %%mm4, (%%"REG_d") \n\t"
+		"movq %%mm5, 16(%%"REG_d") \n\t"
+		"movq %%mm6, 32(%%"REG_d") \n\t"
+
+		"mov %%"REG_a", %%"REG_c" \n\t"
+		"shl $3, %%"REG_c" \n\t"
+		"sub %%"REG_c", %%"REG_S" \n\t"
+		"mov %%"REG_b", %%"REG_c" \n\t"
+		"shl $3, %%"REG_c" \n\t"
+		"sub %%"REG_c", %%"REG_D" \n\t"
 
 		// Second loop for the last four columns
 		"movl $4, %%ecx \n\t"
@@ -184,14 +184,14 @@
 		".balign 16 \n\t"
 		"3: \n\t"
 		
-		"movq (%%esi), %%mm0 \n\t"
-		"movq (%%esi,%%eax), %%mm1 \n\t"
-		"addl %%eax, %%esi \n\t"
-		"addl %%eax, %%esi \n\t"
-		"movq (%%edi), %%mm2 \n\t"
-		"movq (%%edi,%%ebx), %%mm3 \n\t"
-		"addl %%ebx, %%edi \n\t"
-		"addl %%ebx, %%edi \n\t"
+		"movq (%%"REG_S"), %%mm0 \n\t"
+		"movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
+		"add %%"REG_a", %%"REG_S" \n\t"
+		"add %%"REG_a", %%"REG_S" \n\t"
+		"movq (%%"REG_D"), %%mm2 \n\t"
+		"movq (%%"REG_D",%%"REG_b"), %%mm3 \n\t"
+		"add %%"REG_b", %%"REG_D" \n\t"
+		"add %%"REG_b", %%"REG_D" \n\t"
 		"punpckhbw %%mm7, %%mm0 \n\t"
 		"punpckhbw %%mm7, %%mm1 \n\t"
 		"punpckhbw %%mm7, %%mm2 \n\t"
@@ -218,13 +218,13 @@
 		"psubw %%mm1, %%mm4 \n\t"
 		"psubw %%mm2, %%mm5 \n\t"
 		"psubw %%mm3, %%mm6 \n\t"
-		"movq %%mm4, 8(%%edx) \n\t"
-		"movq %%mm5, 24(%%edx) \n\t"
-		"movq %%mm6, 40(%%edx) \n\t"
+		"movq %%mm4, 8(%%"REG_d") \n\t"
+		"movq %%mm5, 24(%%"REG_d") \n\t"
+		"movq %%mm6, 40(%%"REG_d") \n\t"
 
 		"emms \n\t"
 		: 
-		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
+		: "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
 		: "memory"
 		);
 	m->p = m->t = m->s = 0;

Index: vf_noise.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_noise.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- vf_noise.c	20 May 2003 18:36:55 -0000	1.13
+++ vf_noise.c	21 Oct 2004 11:55:19 -0000	1.14
@@ -143,26 +143,26 @@
 
 #ifdef HAVE_MMX
 static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
-	int mmx_len= len&(~7);
+	long mmx_len= len&(~7);
 	noise+=shift;
 
 	asm volatile(
-		"movl %3, %%eax			\n\t"
+		"mov %3, %%"REG_a"		\n\t"
 		"pcmpeqb %%mm7, %%mm7		\n\t"
 		"psllw $15, %%mm7		\n\t"
 		"packsswb %%mm7, %%mm7		\n\t"
 		".balign 16			\n\t"
 		"1:				\n\t"
-		"movq (%0, %%eax), %%mm0	\n\t"
-		"movq (%1, %%eax), %%mm1	\n\t"
+		"movq (%0, %%"REG_a"), %%mm0	\n\t"
+		"movq (%1, %%"REG_a"), %%mm1	\n\t"
 		"pxor %%mm7, %%mm0		\n\t"
 		"paddsb %%mm1, %%mm0		\n\t"
 		"pxor %%mm7, %%mm0		\n\t"
-		"movq %%mm0, (%2, %%eax)	\n\t"
-		"addl $8, %%eax			\n\t"
+		"movq %%mm0, (%2, %%"REG_a")	\n\t"
+		"add $8, %%"REG_a"		\n\t"
 		" js 1b				\n\t"
 		:: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len)
-		: "%eax"
+		: "%"REG_a
 	);
 	if(mmx_len!=len)
 		lineNoise_C(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0);
@@ -172,26 +172,26 @@
 //duplicate of previous except movntq
 #ifdef HAVE_MMX2
 static inline void lineNoise_MMX2(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
-	int mmx_len= len&(~7);
+	long mmx_len= len&(~7);
 	noise+=shift;
 
 	asm volatile(
-		"movl %3, %%eax			\n\t"
+		"mov %3, %%"REG_a"		\n\t"
 		"pcmpeqb %%mm7, %%mm7		\n\t"
 		"psllw $15, %%mm7		\n\t"
 		"packsswb %%mm7, %%mm7		\n\t"
 		".balign 16			\n\t"
 		"1:				\n\t"
-		"movq (%0, %%eax), %%mm0	\n\t"
-		"movq (%1, %%eax), %%mm1	\n\t"
+		"movq (%0, %%"REG_a"), %%mm0	\n\t"
+		"movq (%1, %%"REG_a"), %%mm1	\n\t"
 		"pxor %%mm7, %%mm0		\n\t"
 		"paddsb %%mm1, %%mm0		\n\t"
 		"pxor %%mm7, %%mm0		\n\t"
-		"movntq %%mm0, (%2, %%eax)	\n\t"
-		"addl $8, %%eax			\n\t"
+		"movntq %%mm0, (%2, %%"REG_a")	\n\t"
+		"add $8, %%"REG_a"		\n\t"
 		" js 1b				\n\t"
 		:: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len)
-		: "%eax"
+		: "%"REG_a
 	);
 	if(mmx_len!=len)
 		lineNoise_C(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0);
@@ -214,16 +214,16 @@
 
 #ifdef HAVE_MMX
 static inline void lineNoiseAvg_MMX(uint8_t *dst, uint8_t *src, int len, int8_t **shift){
-	int mmx_len= len&(~7);
+	long mmx_len= len&(~7);
 
 	asm volatile(
-		"movl %5, %%eax			\n\t"
+		"mov %5, %%"REG_a"		\n\t"
 		".balign 16			\n\t"
 		"1:				\n\t"
-		"movq (%1, %%eax), %%mm1	\n\t"
-		"movq (%0, %%eax), %%mm0	\n\t"
-		"paddb (%2, %%eax), %%mm1	\n\t"
-		"paddb (%3, %%eax), %%mm1	\n\t"
+		"movq (%1, %%"REG_a"), %%mm1	\n\t"
+		"movq (%0, %%"REG_a"), %%mm0	\n\t"
+		"paddb (%2, %%"REG_a"), %%mm1	\n\t"
+		"paddb (%3, %%"REG_a"), %%mm1	\n\t"
 		"movq %%mm0, %%mm2		\n\t"
 		"movq %%mm1, %%mm3		\n\t"
 		"punpcklbw %%mm0, %%mm0		\n\t"
@@ -239,12 +239,12 @@
 		"psrlw $8, %%mm1		\n\t"
 		"psrlw $8, %%mm3		\n\t"
                 "packuswb %%mm3, %%mm1		\n\t"
-		"movq %%mm1, (%4, %%eax)	\n\t"
-		"addl $8, %%eax			\n\t"
+		"movq %%mm1, (%4, %%"REG_a")	\n\t"
+		"add $8, %%"REG_a"		\n\t"
 		" js 1b				\n\t"
 		:: "r" (src+mmx_len), "r" (shift[0]+mmx_len), "r" (shift[1]+mmx_len), "r" (shift[2]+mmx_len), 
                    "r" (dst+mmx_len), "g" (-mmx_len)
-		: "%eax"
+		: "%"REG_a
 	);
 
 	if(mmx_len!=len){

Index: vf_spp.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_spp.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- vf_spp.c	19 Sep 2004 22:15:57 -0000	1.23
+++ vf_spp.c	21 Oct 2004 11:55:19 -0000	1.24
@@ -357,9 +357,9 @@
 			"psraw %%mm2, %%mm1	\n\t"
 			"packuswb %%mm1, %%mm0	\n\t"
 			"movq %%mm0, (%1) 	\n\t"
-			"addl $16, %0		\n\t"
-			"addl $8, %1		\n\t"
-			"cmpl %2, %1		\n\t"
+			"add $16, %0		\n\t"
+			"add $8, %1		\n\t"
+			"cmp %2, %1		\n\t"
 			" jb 1b			\n\t"
 			: "+r" (src1), "+r"(dst1)
 			: "r"(dst + width), "r"(dither[y]), "g"(log2_scale), "g"(6-log2_scale)

Index: vf_tfields.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_tfields.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- vf_tfields.c	6 May 2003 02:36:44 -0000	1.7
+++ vf_tfields.c	21 Oct 2004 11:55:19 -0000	1.8
@@ -61,7 +61,7 @@
 static void qpel_li_3DNOW(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
 {
 	int i, j, ssd=ss;
-	int crap1, crap2;
+	long crap1, crap2;
 	if (up) {
 		ssd = -ss;
 		memcpy(d, s, w);
@@ -71,17 +71,17 @@
 	for (i=h-1; i; i--) {
 		asm volatile(
 			"1: \n\t"
-			"movq (%%esi), %%mm0 \n\t"
-			"movq (%%esi,%%eax), %%mm1 \n\t"
+			"movq (%%"REG_S"), %%mm0 \n\t"
+			"movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
 			"pavgusb %%mm0, %%mm1 \n\t"
-			"addl $8, %%esi \n\t"
+			"add $8, %%"REG_S" \n\t"
 			"pavgusb %%mm0, %%mm1 \n\t"
-			"movq %%mm1, (%%edi) \n\t"
-			"addl $8, %%edi \n\t"
+			"movq %%mm1, (%%"REG_D") \n\t"
+			"add $8, %%"REG_D" \n\t"
 			"decl %%ecx \n\t"
 			"jnz 1b \n\t"
 			: "=S"(crap1), "=D"(crap2)
-			: "c"(w>>3), "S"(s), "D"(d), "a"(ssd)
+			: "c"(w>>3), "S"(s), "D"(d), "a"((long)ssd)
 		);
 		for (j=w-(w&7); j<w; j++)
 			d[j] = (s[j+ssd] + 3*s[j])>>2;
@@ -97,7 +97,7 @@
 static void qpel_li_MMX2(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
 {
 	int i, j, ssd=ss;
-	int crap1, crap2;
+	long crap1, crap2;
 	if (up) {
 		ssd = -ss;
 		memcpy(d, s, w);
@@ -108,17 +108,17 @@
 		asm volatile(
 			"pxor %%mm7, %%mm7 \n\t"
 			"2: \n\t"
-			"movq (%%esi), %%mm0 \n\t"
-			"movq (%%esi,%%eax), %%mm1 \n\t"
+			"movq (%%"REG_S"), %%mm0 \n\t"
+			"movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
 			"pavgb %%mm0, %%mm1 \n\t"
-			"addl $8, %%esi \n\t"
+			"add $8, %%"REG_S" \n\t"
 			"pavgb %%mm0, %%mm1 \n\t"
-			"movq %%mm1, (%%edi) \n\t"
-			"addl $8, %%edi \n\t"
+			"movq %%mm1, (%%"REG_D") \n\t"
+			"add $8, %%"REG_D" \n\t"
 			"decl %%ecx \n\t"
 			"jnz 2b \n\t"
 			: "=S"(crap1), "=D"(crap2)
-			: "c"(w>>3), "S"(s), "D"(d), "a"(ssd)
+			: "c"(w>>3), "S"(s), "D"(d), "a"((long)ssd)
 		);
 		for (j=w-(w&7); j<w; j++)
 			d[j] = (s[j+ssd] + 3*s[j])>>2;
@@ -145,11 +145,11 @@
 		asm volatile(
 			"pxor %%mm7, %%mm7 \n\t"
 			"3: \n\t"
-			"movq (%%esi), %%mm0 \n\t"
-			"movq (%%esi), %%mm1 \n\t"
-			"movq (%%esi,%%eax), %%mm2 \n\t"
-			"movq (%%esi,%%eax), %%mm3 \n\t"
-			"addl $8, %%esi \n\t"
+			"movq (%%"REG_S"), %%mm0 \n\t"
+			"movq (%%"REG_S"), %%mm1 \n\t"
+			"movq (%%"REG_S",%%"REG_a"), %%mm2 \n\t"
+			"movq (%%"REG_S",%%"REG_a"), %%mm3 \n\t"
+			"add $8, %%"REG_S" \n\t"
 			"punpcklbw %%mm7, %%mm0 \n\t"
 			"punpckhbw %%mm7, %%mm1 \n\t"
 			"punpcklbw %%mm7, %%mm2 \n\t"
@@ -163,12 +163,12 @@
 			"psrlw $2, %%mm2 \n\t"
 			"psrlw $2, %%mm3 \n\t"
 			"packsswb %%mm3, %%mm2 \n\t"
-			"movq %%mm2, (%%edi) \n\t"
-			"addl $8, %%edi \n\t"
+			"movq %%mm2, (%%"REG_D") \n\t"
+			"add $8, %%"REG_D" \n\t"
 			"decl %%ecx \n\t"
 			"jnz 3b \n\t"
 			: "=S"(crap1), "=D"(crap2)
-			: "c"(w>>3), "S"(s), "D"(d), "a"(ssd)
+			: "c"(w>>3), "S"(s), "D"(d), "a"((long)ssd)
 		);
 		for (j=w-(w&7); j<w; j++)
 			d[j] = (s[j+ssd] + 3*s[j])>>2;
@@ -198,15 +198,15 @@
 	for (i=h-3; i; i--) {
 		asm volatile(
 			"pxor %%mm0, %%mm0 \n\t"
-			"movq (%%edx), %%mm4 \n\t"
-			"movq 8(%%edx), %%mm5 \n\t"
-			"movq 16(%%edx), %%mm6 \n\t"
-			"movq 24(%%edx), %%mm7 \n\t"
+			"movq (%%"REG_d"), %%mm4 \n\t"
+			"movq 8(%%"REG_d"), %%mm5 \n\t"
+			"movq 16(%%"REG_d"), %%mm6 \n\t"
+			"movq 24(%%"REG_d"), %%mm7 \n\t"
 			"4: \n\t"
 
-			"movq (%%esi,%%eax), %%mm1 \n\t"
-			"movq (%%esi), %%mm2 \n\t"
-			"movq (%%esi,%%ebx), %%mm3 \n\t"
+			"movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
+			"movq (%%"REG_S"), %%mm2 \n\t"
+			"movq (%%"REG_S",%%"REG_b"), %%mm3 \n\t"
 			"punpcklbw %%mm0, %%mm1 \n\t"
 			"punpcklbw %%mm0, %%mm2 \n\t"
 			"pmullw %%mm4, %%mm1 \n\t"
@@ -214,38 +214,38 @@
 			"pmullw %%mm5, %%mm2 \n\t"
 			"paddusw %%mm2, %%mm1 \n\t"
 			"pmullw %%mm6, %%mm3 \n\t"
-			"movq (%%esi,%%eax,2), %%mm2 \n\t"
+			"movq (%%"REG_S",%%"REG_a",2), %%mm2 \n\t"
 			"psubusw %%mm3, %%mm1 \n\t"
 			"punpcklbw %%mm0, %%mm2 \n\t"	
 			"pmullw %%mm7, %%mm2 \n\t"
 			"psubusw %%mm2, %%mm1 \n\t"
 			"psrlw $7, %%mm1 \n\t"
 
-			"movq (%%esi,%%eax), %%mm2 \n\t"
-			"movq (%%esi), %%mm3 \n\t"
+			"movq (%%"REG_S",%%"REG_a"), %%mm2 \n\t"
+			"movq (%%"REG_S"), %%mm3 \n\t"
 			"punpckhbw %%mm0, %%mm2 \n\t"
 			"punpckhbw %%mm0, %%mm3 \n\t"
 			"pmullw %%mm4, %%mm2 \n\t"
 			"pmullw %%mm5, %%mm3 \n\t"
 			"paddusw %%mm3, %%mm2 \n\t"
-			"movq (%%esi,%%ebx), %%mm3 \n\t"
+			"movq (%%"REG_S",%%"REG_b"), %%mm3 \n\t"
 			"punpckhbw %%mm0, %%mm3 \n\t"
 			"pmullw %%mm6, %%mm3 \n\t"
 			"psubusw %%mm3, %%mm2 \n\t"
-			"movq (%%esi,%%eax,2), %%mm3 \n\t"
+			"movq (%%"REG_S",%%"REG_a",2), %%mm3 \n\t"
 			"punpckhbw %%mm0, %%mm3 \n\t"	
-			"addl $8, %%esi \n\t"
+			"add $8, %%"REG_S" \n\t"
 			"pmullw %%mm7, %%mm3 \n\t"
 			"psubusw %%mm3, %%mm2 \n\t"
 			"psrlw $7, %%mm2 \n\t"
 			
 			"packuswb %%mm2, %%mm1 \n\t"
-			"movq %%mm1, (%%edi) \n\t"
-			"addl $8, %%edi \n\t"
+			"movq %%mm1, (%%"REG_D") \n\t"
+			"add $8, %%"REG_D" \n\t"
 			"decl %%ecx \n\t"
 			"jnz 4b \n\t"
 			: "=S"(crap1), "=D"(crap2)
-			: "c"(w>>3), "S"(s), "D"(d), "a"(ssd), "b"(-ssd), "d"(filter)
+			: "c"(w>>3), "S"(s), "D"(d), "a"((long)ssd), "b"((long)-ssd), "d"(filter)
 		);
 		for (j=w-(w&7); j<w; j++)
 			d[j] = (-9*s[j-ssd] + 111*s[j] + 29*s[j+ssd] - 3*s[j+ssd+ssd])>>7;




More information about the MPlayer-cvslog mailing list