changeset 3738:5c1da9bc17a3

memset(?, 0, 256*sizeof(float)) in MMX
author michael
date Tue, 25 Dec 2001 17:19:18 +0000
parents 04ca2b6ddb1e
children b6040dbc751a
files liba52/downmix.c
diffstat 1 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/liba52/downmix.c	Tue Dec 25 16:43:27 2001 +0000
+++ b/liba52/downmix.c	Tue Dec 25 17:19:18 2001 +0000
@@ -65,7 +65,7 @@
     output = flags & A52_CHANNEL_MASK;
     if (output > A52_DOLBY)
 	return -1;
-
+    
     output = table[output][input & 7];
 
     if ((output == A52_STEREO) &&
@@ -593,9 +593,25 @@
 static void zero (sample_t * samples)
 {
     int i;
-
+#ifdef HAVE_MMX
+	asm volatile(
+		"movl $-1024, %%esi		\n\t"
+		"pxor %%mm0, %%mm0		\n\t"
+		"1:				\n\t"
+		"movq %%mm0, (%0, %%esi)	\n\t"
+		"movq %%mm0, 8(%0, %%esi)	\n\t"
+		"movq %%mm0, 16(%0, %%esi)	\n\t"
+		"movq %%mm0, 24(%0, %%esi)	\n\t"
+		"addl $32, %%esi		\n\t"
+		" jnz 1b			\n\t"
+		"emms"
+	:: "r" (samples+256)
+	: "%esi"
+	);
+#else
     for (i = 0; i < 256; i++)
 	samples[i] = 0;
+#endif
 }
 
 void downmix (sample_t * samples, int acmod, int output, sample_t bias,