1
0
Fork 0
forked from len0rd/rockbox

opus: speed up arm asm MULT16_32_Q15

Reorder operands to take advantage of the early termination of
multiplications. Saves 2.5MHz decoding a 64kbps opus test file
on c200 (pp).

Change-Id: I470266dc870ab183ece3b23426d41e2a64342a71
This commit is contained in:
Nils Wallménius 2012-10-01 22:36:57 +02:00
parent d7799aaf33
commit 8687b98993

View file

@ -58,7 +58,7 @@ static inline int32_t MULT16_32_Q15(int32_t a, int32_t b)
static inline int32_t MULT16_32_Q15(int32_t a, int32_t b) static inline int32_t MULT16_32_Q15(int32_t a, int32_t b)
{ {
int32_t lo, hi; int32_t lo, hi;
asm volatile("smull %[lo], %[hi], %[a], %[b] \n\t" asm volatile("smull %[lo], %[hi], %[b], %[a] \n\t"
"mov %[lo], %[lo], lsr #15 \n\t" "mov %[lo], %[lo], lsr #15 \n\t"
"orr %[hi], %[lo], %[hi], lsl #17 \n\t" "orr %[hi], %[lo], %[hi], lsl #17 \n\t"
: [lo] "=&r" (lo), [hi] "=&r" (hi) : [lo] "=&r" (lo), [hi] "=&r" (hi)