From caaea275eba6a01c32c84c19bcb4210fbc65eb1c Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sun, 21 Sep 2025 15:33:55 -0400 Subject: [PATCH] libspc: Temporarily disable problematic armv4 asm optimization asm volatile ( "mov %[t0], %[out], asr #11 \n" "mul %[out], %[t0], %[envx] \n" : [out]"+r"(output), [t0]"=&r"(t0) : [envx]"r"((int) voice->envx)); This is resulting in "Rd and Rm should be different in mul" error, because the compiler is putting [out] and [t0] into the same register. After some poking there doesn't appear to be a sane way to change the constraints, so just disable it for now. Change-Id: I7827713c8aadb27f0bf4a6f4a3e1d910c6193686 --- lib/rbcodec/codecs/libspc/cpu/spc_dsp_armv4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rbcodec/codecs/libspc/cpu/spc_dsp_armv4.c b/lib/rbcodec/codecs/libspc/cpu/spc_dsp_armv4.c index 7eacc3baf9..ff34c910d7 100644 --- a/lib/rbcodec/codecs/libspc/cpu/spc_dsp_armv4.c +++ b/lib/rbcodec/codecs/libspc/cpu/spc_dsp_armv4.c @@ -50,6 +50,7 @@ static inline int gaussian_fast_interp( int16_t const* samples, return output; } +#if 0 // first asm block generates "Rd and Rm should be different in mul" error #define SPC_GAUSSIAN_FAST_AMP static inline int gaussian_fast_amp( struct voice_t* voice, int output, int* amp_0, int* amp_1 ) @@ -73,6 +74,7 @@ static inline int gaussian_fast_amp( struct voice_t* voice, int output, return output; } +#endif #define SPC_GAUSSIAN_SLOW_INTERP static inline int gaussian_slow_interp( int16_t const* samples, @@ -144,7 +146,7 @@ static inline int linear_interp( int16_t const* samples, int32_t position ) asm volatile( "mov %[y1], %[f], lsr #12 \n" - "eor %[f], %[f], %[y1], lsl #12 \n" + "eor %[f], %[f], %[y1], lsl #12 \n" "add %[y1], %[y0], %[y1], lsl #1 \n" "ldrsh %[y0], [%[y1], #2] \n" "ldrsh %[y1], [%[y1], #4] \n"