summaryrefslogtreecommitdiff
path: root/apps/plugins/pdbox/PDa/src/m_fixed.h
diff options
context:
space:
mode:
authorWincent Balin <wincent@rockbox.org>2010-06-03 22:03:37 +0000
committerWincent Balin <wincent@rockbox.org>2010-06-03 22:03:37 +0000
commit2e5b1b1a9cab0ff19170815fda13f40268126027 (patch)
treef5bdfad43f09a329c7b07d15b0d5f44505ce7ecd /apps/plugins/pdbox/PDa/src/m_fixed.h
parent2438d8b58467d9498ab2009636d3df50447390bc (diff)
downloadrockbox-2e5b1b1a9cab0ff19170815fda13f40268126027.tar.gz
rockbox-2e5b1b1a9cab0ff19170815fda13f40268126027.zip
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
Diffstat (limited to 'apps/plugins/pdbox/PDa/src/m_fixed.h')
-rw-r--r--apps/plugins/pdbox/PDa/src/m_fixed.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/plugins/pdbox/PDa/src/m_fixed.h b/apps/plugins/pdbox/PDa/src/m_fixed.h
index aa7b74b5ba..57c9296457 100644
--- a/apps/plugins/pdbox/PDa/src/m_fixed.h
+++ b/apps/plugins/pdbox/PDa/src/m_fixed.h
@@ -12,8 +12,24 @@ typedef int t_sample;
12 12
13/* fixed point multiplication and division */ 13/* fixed point multiplication and division */
14 14
15#if defined(ROCKBOX) && defined(CPU_ARM)
16#define mult(A,B) \
17 ({ \
18 t_fixed lo; \
19 t_fixed hi; \
20 asm volatile ( \
21 "smull %[lo], %[hi], %[x], %[y] \n\t" /* multiply */ \
22 "mov %[lo], %[lo], lsr %[shr] \n\t" /* lo >>= fix1 */ \
23 "orr %[lo], %[lo], %[hi], lsl %[shl]" /* lo |= (hi << (32-fix1)) */ \
24 : [lo]"=&r"(lo), [hi]"=&r"(hi) \
25 : [x]"r"(A), [y]"r"(B), [shr]"r"(fix1), [shl]"r"(32-fix1)); \
26 lo; \
27 })
28#define idiv(a,b) ((((long long) (a) )<<fix1)/(long long) (b) )
29#else /* ROCKBOX && CPU_ARM */
15#define mult(a,b) (long long)(((long long) (a) * (long long) (b))>>fix1) 30#define mult(a,b) (long long)(((long long) (a) * (long long) (b))>>fix1)
16#define idiv(a,b) ((((long long) (a) )<<fix1)/(long long) (b) ) 31#define idiv(a,b) ((((long long) (a) )<<fix1)/(long long) (b) )
32#endif /* ROCKBOX && CPU_ARM */
17 33
18/* conversion macros */ 34/* conversion macros */
19 35