1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Solomon Peachy 2025-09-21 15:33:55 -04:00
parent bb251ba603
commit caaea275eb

View file

@ -50,6 +50,7 @@ static inline int gaussian_fast_interp( int16_t const* samples,
return output; return output;
} }
#if 0 // first asm block generates "Rd and Rm should be different in mul" error
#define SPC_GAUSSIAN_FAST_AMP #define SPC_GAUSSIAN_FAST_AMP
static inline int gaussian_fast_amp( struct voice_t* voice, int output, static inline int gaussian_fast_amp( struct voice_t* voice, int output,
int* amp_0, int* amp_1 ) int* amp_0, int* amp_1 )
@ -73,6 +74,7 @@ static inline int gaussian_fast_amp( struct voice_t* voice, int output,
return output; return output;
} }
#endif
#define SPC_GAUSSIAN_SLOW_INTERP #define SPC_GAUSSIAN_SLOW_INTERP
static inline int gaussian_slow_interp( int16_t const* samples, 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( asm volatile(
"mov %[y1], %[f], lsr #12 \n" "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" "add %[y1], %[y0], %[y1], lsl #1 \n"
"ldrsh %[y0], [%[y1], #2] \n" "ldrsh %[y0], [%[y1], #2] \n"
"ldrsh %[y1], [%[y1], #4] \n" "ldrsh %[y1], [%[y1], #4] \n"