changeset 222:4f83fb0c957a libavcodec

workaround gcc bug "m" (0) avoiding useage of ebx
author arpi_esp
date Mon, 28 Jan 2002 19:34:16 +0000
parents fe243b4aec02
children f0e15c953995
files i386/mpegvideo_mmx_template.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/i386/mpegvideo_mmx_template.c	Mon Jan 28 18:06:28 2002 +0000
+++ b/i386/mpegvideo_mmx_template.c	Mon Jan 28 19:34:16 2002 +0000
@@ -67,17 +67,17 @@
 #if 1
 	asm volatile (
 		"xorl %%edx, %%edx	\n\t"
-		"mul %%ebx		\n\t"
+		"mul %%ecx		\n\t"
 		: "=d" (temp_block[0]), "=a"(dummy)
-		: "a" (block[0] + (q >> 1)), "b" (inverse[q])
+		: "a" (block[0] + (q >> 1)), "c" (inverse[q])
 	);
 #else
 	asm volatile (
 		"xorl %%edx, %%edx	\n\t"
-		"divw %%bx		\n\t"
+		"divw %%cx		\n\t"
 		"movzwl %%ax, %%eax	\n\t"
 		: "=a" (temp_block[0])
-		: "a" (block[0] + (q >> 1)), "b" (q)
+		: "a" (block[0] + (q >> 1)), "c" (q)
 		: "%edx"
 	);
 #endif
@@ -119,8 +119,10 @@
 	SPREADW(%%mm3)
 	"movd %4, %%mm4			\n\t"
 	SPREADW(%%mm4)
+#ifndef HAVE_MMX2	
 	"movd %5, %%mm5			\n\t"
 	SPREADW(%%mm5)
+#endif
 	"pxor %%mm7, %%mm7		\n\t"
 	"movd %%eax, %%mm2		\n\t"
 	SPREADW(%%mm2)
@@ -160,9 +162,9 @@
 	: "+a" (last_non_zero_p1)
 	: "r" (block+64), "r" (qmat+64), 
 #ifdef HAVE_MMX2
-	  "m" (maxLevel),          "m" (minLevel),                    "m" (0 /* dummy */), "g" (2*i - 128),
+	  "m" (maxLevel),          "m" (minLevel),                    "m" (minLevel /* dummy */), "g" (2*i - 128),
 #else
-	  "m" (0x7FFF - maxLevel), "m" (0x7FFF -maxLevel + minLevel), "m" (minLevel),      "g" (2*i - 128),
+	  "m" (0x7FFF - maxLevel), "m" (0x7FFF -maxLevel + minLevel), "m" (minLevel),             "g" (2*i - 128),
 #endif
 	  "r" (inv_zigzag_direct16+64), "r" (temp_block+64)
     );