[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec/i386 idct_mmx.c,1.9,1.10

Michael Niedermayer CVS michael
Wed Jun 1 13:57:00 CEST 2005


Update of /cvsroot/ffmpeg/ffmpeg/libavcodec/i386
In directory mail:/var2/tmp/cvs-serv32200/libavcodec/i386

Modified Files:
	idct_mmx.c 
Log Message:
merge a few asm blocks so gcc cant unoptimize it (658->631 dezicycles on duron)


Index: idct_mmx.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/i386/idct_mmx.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- idct_mmx.c	1 Jun 2005 11:36:32 -0000	1.9
+++ idct_mmx.c	1 Jun 2005 11:56:58 -0000	1.10
@@ -637,14 +637,13 @@
     SBUTTERFLY( a, c, d, dq ) /* a=aeim d=bfjn */\
     SBUTTERFLY( t, b, c, dq ) /* t=cgko c=dhlp */
 
-#define STORE_DIFF_4P( p, t, z, dst ) \
-    asm volatile(\
+#define STORE_DIFF_4P( p, t, z ) \
         "psraw      $6,     "#p" \n\t"\
         "movd       (%0),   "#t" \n\t"\
         "punpcklbw "#z",    "#t" \n\t"\
         "paddsw    "#t",    "#p" \n\t"\
         "packuswb  "#z",    "#p" \n\t"\
-        "movd      "#p",    (%0) \n\t" :: "r"(dst) )
+        "movd      "#p",    (%0) \n\t"
 
 static const uint64_t ff_pw_32 attribute_used __attribute__ ((aligned(8))) = 0x0020002000200020ULL;
 
@@ -674,8 +673,15 @@
         "pxor %%mm7, %%mm7    \n\t"
     :: "m"(ff_pw_32));
 
-    STORE_DIFF_4P( %%mm0, %%mm1, %%mm7, &dst[0*stride] );
-    STORE_DIFF_4P( %%mm2, %%mm1, %%mm7, &dst[1*stride] );
-    STORE_DIFF_4P( %%mm3, %%mm1, %%mm7, &dst[2*stride] );
-    STORE_DIFF_4P( %%mm4, %%mm1, %%mm7, &dst[3*stride] );
+    asm volatile(
+    STORE_DIFF_4P( %%mm0, %%mm1, %%mm7)
+        "addl %1, %0             \n\t"
+    STORE_DIFF_4P( %%mm2, %%mm1, %%mm7)
+        "addl %1, %0             \n\t"
+    STORE_DIFF_4P( %%mm3, %%mm1, %%mm7)
+        "addl %1, %0             \n\t"
+    STORE_DIFF_4P( %%mm4, %%mm1, %%mm7)
+        : "+r"(dst)
+        : "r" (stride)
+    );
 }





More information about the ffmpeg-cvslog mailing list