changeset 3675:a6f4cce5001a

mix2to1 in SSE
author michael
date Sun, 23 Dec 2001 17:08:33 +0000
parents d90916a2fa9a
children 45ecea1c23f3
files liba52/downmix.c
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liba52/downmix.c	Sun Dec 23 16:57:52 2001 +0000
+++ b/liba52/downmix.c	Sun Dec 23 17:08:33 2001 +0000
@@ -305,8 +305,29 @@
 {
     int i;
 
+#ifdef HAVE_SSE
+	asm volatile(
+	"movlps %2, %%xmm7		\n\t"
+	"shufps $0x00, %%xmm7, %%xmm7	\n\t"
+	"movl $-1024, %%esi		\n\t"
+	"1:				\n\t"
+	"movaps (%0, %%esi), %%xmm0	\n\t" 
+	"movaps 16(%0, %%esi), %%xmm1	\n\t" 
+	"addps (%1, %%esi), %%xmm0	\n\t" 
+	"addps 16(%1, %%esi), %%xmm1	\n\t" 
+	"addps %%xmm7, %%xmm0		\n\t"
+	"addps %%xmm7, %%xmm1		\n\t"
+	"movaps %%xmm0, (%1, %%esi)	\n\t"
+	"movaps %%xmm1, 16(%1, %%esi)	\n\t"
+	"addl $32, %%esi		\n\t"
+	" jnz 1b			\n\t"
+	:: "r" (src+256), "r" (dest+256), "m" (bias)
+	: "%esi"
+	);
+#else
     for (i = 0; i < 256; i++)
 	dest[i] += src[i] + bias;
+#endif
 }
 
 static void mix3to1 (sample_t * samples, sample_t bias)