changeset 967:274b518c4ecb libavcodec

PIC / ebx fix
author michaelni
date Tue, 07 Jan 2003 13:00:38 +0000
parents 7ef9226f430e
children 64f1a11b5f86
files i386/dsputil_mmx.c i386/dsputil_mmx_rnd.h
diffstat 2 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/i386/dsputil_mmx.c	Tue Jan 07 11:59:34 2003 +0000
+++ b/i386/dsputil_mmx.c	Tue Jan 07 13:00:38 2003 +0000
@@ -790,7 +790,7 @@
         "addl %4, %1			\n\t"\
         "decl %2			\n\t"\
         " jnz 1b				\n\t"\
-        : "+a"(src), "+b"(dst), "+c"(h)\
+        : "+a"(src), "+c"(dst), "+m"(h)\
         : "d"(srcStride), "S"(dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(temp), "m"(ROUNDER)\
         : "memory"\
     );\
@@ -903,7 +903,7 @@
         "addl %4, %1			\n\t"\
         "decl %2			\n\t"\
         " jnz 1b			\n\t"\
-        : "+a"(src), "+b"(dst), "+c"(h)\
+        : "+a"(src), "+c"(dst), "+m"(h)\
         : "S"(srcStride), "D"(dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(temp), "m"(ROUNDER)\
         : "memory"\
     );\
@@ -961,14 +961,14 @@
         "punpckhbw %%mm7, %%mm3		\n\t"\
         "movq %%mm0, (%1)		\n\t"\
         "movq %%mm1, 17*8(%1)		\n\t"\
-        "movq %%mm2, (%1, %4)		\n\t"\
-        "movq %%mm3, (%1, %5)		\n\t"\
+        "movq %%mm2, 2*17*8(%1)		\n\t"\
+        "movq %%mm3, 3*17*8(%1)		\n\t"\
         "addl $8, %1			\n\t"\
         "addl %3, %0			\n\t"\
         "decl %2			\n\t"\
         " jnz 1b			\n\t"\
         : "+r" (src), "+r" (temp_ptr), "+r"(count)\
-        : "r" (srcStride), "r"(2*8*17), "r"(3*8*17)\
+        : "r" (srcStride)\
         : "memory"\
     );\
     \
@@ -1014,7 +1014,7 @@
         "decl %2			\n\t"\
         " jnz 1b			\n\t"\
         \
-        : "+r"(temp_ptr), "+r"(dst), "+r"(count)\
+        : "+r"(temp_ptr), "+r"(dst), "+g"(count)\
         : "r"(dstStride), "r"(2*dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(ROUNDER), "g"(4-14*dstStride)\
         :"memory"\
     );\
--- a/i386/dsputil_mmx_rnd.h	Tue Jan 07 11:59:34 2003 +0000
+++ b/i386/dsputil_mmx_rnd.h	Tue Jan 07 13:00:38 2003 +0000
@@ -85,7 +85,11 @@
 	"addl	%5, %3			\n\t"
 	"subl	$4, %0			\n\t"
 	"jnz	1b			\n\t"
-	:"+a"(h), "+b"(src1), "+c"(src2), "+d"(dst)
+#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+        :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
+#else
+        :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
+#endif
 	:"S"(src1Stride), "D"(dstStride)
 	:"memory");
 }
@@ -163,7 +167,11 @@
 	"addl	$32, %2			\n\t"
 	"subl	$2, %0			\n\t"
 	"jnz	1b			\n\t"
-	:"+a"(h), "+b"(src1), "+c"(src2), "+d"(dst)
+#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+	:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
+#else
+	:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
+#endif
 	:"S"(src1Stride), "D"(dstStride)
 	:"memory"); 
 }