[Mplayer-cvslog] CVS: main/liba52 imdct.c,1.7,1.8
Michael Niedermayer
michael at mplayer.dev.hu
Mon Dec 17 01:37:58 CET 2001
Update of /cvsroot/mplayer/main/liba52
In directory mplayer:/var/tmp.root/cvs-serv26074
Modified Files:
imdct.c
Log Message:
sse opt
Index: imdct.c
===================================================================
RCS file: /cvsroot/mplayer/main/liba52/imdct.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- imdct.c 16 Dec 2001 23:00:03 -0000 1.7
+++ imdct.c 17 Dec 2001 00:37:55 -0000 1.8
@@ -370,7 +370,7 @@
: "%esi"
);
-
+/* C version of the following asm loop
for (m=3; m < 7; m++) {
two_m = (1 << m);
@@ -391,6 +391,41 @@
}
}
}
+*/
+ for (m=3; m < 7; m++) {
+ two_m = (1 << m);
+ two_m_plus_one = two_m<<1;
+ asm volatile(
+ "movl %0, %%esi \n\t"
+ ".balign 16 \n\t"
+ "1: \n\t"
+ "xorl %%edi, %%edi \n\t" // k
+ "leal (%%esi, %3), %%edx \n\t"
+ "2: \n\t"
+ "movaps (%%edx, %%edi), %%xmm1 \n\t"
+ "movaps (%4, %%edi, 2), %%xmm2 \n\t"
+ "mulps %%xmm1, %%xmm2 \n\t"
+ "shufps $0xB1, %%xmm1, %%xmm1 \n\t"
+ "mulps 16(%4, %%edi, 2), %%xmm1 \n\t"
+ "movaps (%%esi, %%edi), %%xmm0 \n\t"
+ "addps %%xmm2, %%xmm1 \n\t"
+ "movaps %%xmm1, %%xmm2 \n\t"
+ "addps %%xmm0, %%xmm1 \n\t"
+ "subps %%xmm2, %%xmm0 \n\t"
+ "movaps %%xmm1, (%%esi, %%edi) \n\t"
+ "movaps %%xmm0, (%%edx, %%edi) \n\t"
+ "addl $16, %%edi \n\t"
+ "cmpl %3, %%edi \n\t" //FIXME (opt) count against 0
+ " jb 2b \n\t"
+ "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),
+ "r" (sseW[m])
+ : "%esi", "%edi", "%edx"
+ );
+ }
+
#else
/* unoptimized variant
for (m=1; m < 7; m++) {
More information about the MPlayer-cvslog
mailing list