From 66fee3eb55ee1238bd19b2813a36350e082ece2c Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Fri, 24 Jun 2011 11:52:17 +0000 Subject: Backport r30063 to the v3.9 branch. SPC Codec: Restore correct FIR buffer alignment when an address mask is used. It must be FIR_BUF_ALIGN. Fix Coldfire assembly constraint where an input parameter was also being written. git-svn-id: svn://svn.rockbox.org/rockbox/branches/v3_9@30064 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libspc/spc_dsp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'apps/codecs/libspc/spc_dsp.c') diff --git a/apps/codecs/libspc/spc_dsp.c b/apps/codecs/libspc/spc_dsp.c index c5833e21d6..0017b2a0a0 100644 --- a/apps/codecs/libspc/spc_dsp.c +++ b/apps/codecs/libspc/spc_dsp.c @@ -28,7 +28,8 @@ #include "spc_profiler.h" #if defined(CPU_COLDFIRE) || defined (CPU_ARM) -int32_t fir_buf[FIR_BUF_CNT] IBSS_ATTR_SPC MEM_ALIGN_ATTR; +int32_t fir_buf[FIR_BUF_CNT] IBSS_ATTR_SPC + __attribute__((aligned(FIR_BUF_ALIGN*1))); #endif #if SPC_BRRCACHE /* a little extra for samples that go past end */ @@ -1276,6 +1277,8 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) /* Feedback into echo buffer */ if ( !(this->r.g.flags & 0x20) ) { + int sh = 1 << 9; + asm volatile ( /* scale echo voices; saturate if overflow */ "mac.l %[sh], %[e1] , %%acc1 \r\n" @@ -1298,11 +1301,10 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) "or.l %[sh], %[e0] \r\n" /* save final feedback into echo buffer */ "move.l %[e0], (%[echo_ptr]) \r\n" - : [e0]"+d"(echo_0), [e1]"+d"(echo_1) + : [e0]"+d"(echo_0), [e1]"+d"(echo_1), [sh]"+d"(sh) : [out_0]"r"(out_0), [out_1]"r"(out_1), [ef]"r"((int)this->r.g.echo_feedback), - [echo_ptr]"a"((int32_t *)echo_ptr), - [sh]"d"(1 << 9) + [echo_ptr]"a"((int32_t *)echo_ptr) ); } -- cgit v1.2.3