forked from len0rd/rockbox
Add simple ASMed fixed point multiply functions for ARM to AC3. Gives a 38% speed up on my one sample with a Sansa.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18570 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0a1d3653bd
commit
9bc16e491d
1 changed files with 30 additions and 0 deletions
|
|
@ -166,6 +166,36 @@ typedef int16_t quantizer_t;
|
||||||
: [A] "r" ((a)), [B] "r" ((b))); \
|
: [A] "r" ((a)), [B] "r" ((b))); \
|
||||||
t; \
|
t; \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
#elif defined(CPU_ARM)
|
||||||
|
#define MUL(x, y) \
|
||||||
|
({ int32_t __hi; \
|
||||||
|
uint32_t __lo; \
|
||||||
|
int32_t __result; \
|
||||||
|
asm ("smull %0, %1, %3, %4\n\t" \
|
||||||
|
"movs %2, %1, lsl #2" \
|
||||||
|
: "=&r" (__lo), "=&r" (__hi), "=r" (__result) \
|
||||||
|
: "%r" (x), "r" (y) \
|
||||||
|
: "cc"); \
|
||||||
|
__result; \
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
#define MUL_L(x, y) \
|
||||||
|
({ int32_t __hi; \
|
||||||
|
uint32_t __lo; \
|
||||||
|
int32_t __result; \
|
||||||
|
asm ("smull %0, %1, %3, %4\n\t" \
|
||||||
|
"movs %0, %0, lsr %5\n\t" \
|
||||||
|
"adc %2, %0, %1, lsl %6" \
|
||||||
|
: "=&r" (__lo), "=&r" (__hi), "=r" (__result) \
|
||||||
|
: "%r" (x), "r" (y), \
|
||||||
|
"M" (26), "M" (32 - 26) \
|
||||||
|
: "cc"); \
|
||||||
|
__result; \
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
#elif 1
|
#elif 1
|
||||||
#define MUL(a,b) \
|
#define MUL(a,b) \
|
||||||
({ int32_t _ta=(a), _tb=(b), _tc; \
|
({ int32_t _ta=(a), _tb=(b), _tc; \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue