1
0
Fork 0
forked from len0rd/rockbox

pdbox: Applied several changes by Buschel. Reintroduced compilation for iPods.

Changes by Buschel:

* Reduced footprint by making cosine table of size 1^13 instead of 1^15
* Corrected interpolation in the cos~ object
* Optimized multiplication on ARM platforms



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26534 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Wincent Balin 2010-06-03 22:03:37 +00:00
parent 2438d8b584
commit 2e5b1b1a9c
5 changed files with 1070 additions and 3 deletions

View file

@ -12,8 +12,24 @@ typedef int t_sample;
/* fixed point multiplication and division */
#if defined(ROCKBOX) && defined(CPU_ARM)
#define mult(A,B) \
({ \
t_fixed lo; \
t_fixed hi; \
asm volatile ( \
"smull %[lo], %[hi], %[x], %[y] \n\t" /* multiply */ \
"mov %[lo], %[lo], lsr %[shr] \n\t" /* lo >>= fix1 */ \
"orr %[lo], %[lo], %[hi], lsl %[shl]" /* lo |= (hi << (32-fix1)) */ \
: [lo]"=&r"(lo), [hi]"=&r"(hi) \
: [x]"r"(A), [y]"r"(B), [shr]"r"(fix1), [shl]"r"(32-fix1)); \
lo; \
})
#define idiv(a,b) ((((long long) (a) )<<fix1)/(long long) (b) )
#else /* ROCKBOX && CPU_ARM */
#define mult(a,b) (long long)(((long long) (a) * (long long) (b))>>fix1)
#define idiv(a,b) ((((long long) (a) )<<fix1)/(long long) (b) )
#endif /* ROCKBOX && CPU_ARM */
/* conversion macros */