From 4f5b390a6df9733b46e254a7e367e066a80ccb9b Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Tue, 20 Jul 2010 23:35:07 +0000 Subject: Convert inline coldfire assembler to a 'real' assembler function, with tweaks by Buschel. Speeds up mpc decoding by ~1% on h300. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27504 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libmusepack/synth_filter_coldfire.S | 78 +++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 apps/codecs/libmusepack/synth_filter_coldfire.S (limited to 'apps/codecs/libmusepack/synth_filter_coldfire.S') diff --git a/apps/codecs/libmusepack/synth_filter_coldfire.S b/apps/codecs/libmusepack/synth_filter_coldfire.S new file mode 100644 index 0000000000..758ab3d496 --- /dev/null +++ b/apps/codecs/libmusepack/synth_filter_coldfire.S @@ -0,0 +1,78 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2005 by Thom Johansen + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "config.h" +/* + * static void + * mpc_decoder_windowing_D(MPC_SAMPLE_FORMAT * Data, + * const MPC_SAMPLE_FORMAT * V, + * const MPC_SAMPLE_FORMAT * D) + */ + +#if defined(USE_IRAM) + .section .icode +#else + .text +#endif + .align 2 + .global mpc_decoder_windowing_D + .type mpc_decoder_windowing_D, @function + +mpc_decoder_windowing_D: + lea.l (-9*4, %sp), %sp + movem.l %d2-%d7/%a2-%a4, (%sp) | save some registers + movem.l (9*4+4, %sp), %a0-%a2 | a0 = Data, a1 = V, a2 = D + moveq.l #32, %d0 | loop counter + + move.l (%a1), %a4 + 0: | loop + movem.l (%a2), %d1-%d7/%a3 + + mac.l %d1, %a4, ( 96*4, %a1), %a4, %acc0 + mac.l %d2, %a4, (128*4, %a1), %a4, %acc0 + mac.l %d3, %a4, (224*4, %a1), %a4, %acc0 + mac.l %d4, %a4, (256*4, %a1), %a4, %acc0 + mac.l %d5, %a4, (352*4, %a1), %a4, %acc0 + mac.l %d6, %a4, (384*4, %a1), %a4, %acc0 + mac.l %d7, %a4, (480*4, %a1), %a4, %acc0 + mac.l %a3, %a4, (512*4, %a1), %a4, %acc0 + movem.l (8*4, %a2), %d1-%d7/%a3 + mac.l %d1, %a4, (608*4, %a1), %a4, %acc0 + mac.l %d2, %a4, (640*4, %a1), %a4, %acc0 + mac.l %d3, %a4, (736*4, %a1), %a4, %acc0 + mac.l %d4, %a4, (768*4, %a1), %a4, %acc0 + mac.l %d5, %a4, (864*4, %a1), %a4, %acc0 + mac.l %d6, %a4, (896*4, %a1), %a4, %acc0 + mac.l %d7, %a4, (992*4, %a1), %a4, %acc0 + mac.l %a3, %a4, ( 4, %a1), %a4, %acc0 + + lea.l (16*4, %a2), %a2 + addq.l #4, %a1 + movclr.l %acc0, %d1 + lsl.l #1, %d1 + move.l %d1, (%a0)+ + subq.l #1, %d0 + bne 0b + + movem.l (%sp), %d2-%d7/%a2-%a4 | restore stacked regs + lea.l (9*4, %sp), %sp + rts + -- cgit v1.2.3