diff decoders/libmpg123/equalizer_3dnow.S @ 562:7e08477b0fc1

MP3 decoder upgrade work. Ripped out SMPEG and mpglib support, replaced it with "mpg123.c" and libmpg123. libmpg123 is a much better version of mpglib, so it should solve all the problems about MP3's not seeking, or most modern MP3's not playing at all, etc. Since you no longer have to make a tradeoff with SMPEG for features, and SMPEG is basically rotting, I removed it from the project. There is still work to be done with libmpg123...there are MMX, 3DNow, SSE, Altivec, etc decoders which we don't have enabled at the moment, and the build system could use some work to make this compile more cleanly, etc. Still: huge win.
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 30 Jan 2009 02:44:47 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/decoders/libmpg123/equalizer_3dnow.S	Fri Jan 30 02:44:47 2009 -0500
@@ -0,0 +1,73 @@
+/*
+	equalizer_3dnow: 3DNow! optimized do_equalizer()
+
+	copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+	see COPYING and AUTHORS files in distribution or http://mpg123.org
+	initially written by KIMURA Takuhiro
+*/
+
+#include "mangle.h"
+
+.text
+	ALIGN4
+.globl ASM_NAME(do_equalizer_3dnow)
+/*	.type	 ASM_NAME(do_equalizer_3dnow),@function */
+/* void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]); */
+ASM_NAME(do_equalizer_3dnow):
+	pushl %esi
+	pushl %ebx
+	/* bandPtr */
+	movl 12(%esp),%ebx
+	/* channel */
+	movl 16(%esp),%ecx
+	xorl %edx,%edx
+	/* equalizer */
+	movl 20(%esp),%esi
+	sall $7,%ecx
+	ALIGN4
+.L9:
+	movq (%ebx,%edx),%mm0
+	pfmul (%esi,%ecx),%mm0
+
+	movq 8(%ebx,%edx),%mm1
+	pfmul 8(%esi,%ecx),%mm1
+	movq %mm0,(%ebx,%edx)
+	
+	movq 16(%ebx,%edx),%mm0
+	pfmul 16(%esi,%ecx),%mm0
+	movq %mm1,8(%ebx,%edx)
+	
+	movq 24(%ebx,%edx),%mm1
+	pfmul 24(%esi,%ecx),%mm1
+	movq %mm0,16(%ebx,%edx)
+
+	movq 32(%ebx,%edx),%mm0
+	pfmul 32(%esi,%ecx),%mm0
+	movq %mm1,24(%ebx,%edx)
+
+	movq 40(%ebx,%edx),%mm1
+	pfmul 40(%esi,%ecx),%mm1
+	movq %mm0,32(%ebx,%edx)
+	
+	movq 48(%ebx,%edx),%mm0
+	pfmul 48(%esi,%ecx),%mm0
+	movq %mm1,40(%ebx,%edx)
+	
+	movq 56(%ebx,%edx),%mm1
+	pfmul 56(%esi,%ecx),%mm1
+	movq %mm0,48(%ebx,%edx)
+	movq %mm1,56(%ebx,%edx)
+	
+	addl $64,%edx
+	addl $32,%ecx
+	cmpl $124,%edx
+	jle .L9
+	ALIGN4
+	popl %ebx
+	popl %esi
+	ret
+
+/* Mark non-executable stack. */
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif