diff options
| author | Wincent Balin <wincent@rockbox.org> | 2010-06-03 22:03:37 +0000 |
|---|---|---|
| committer | Wincent Balin <wincent@rockbox.org> | 2010-06-03 22:03:37 +0000 |
| commit | 2e5b1b1a9cab0ff19170815fda13f40268126027 (patch) | |
| tree | f5bdfad43f09a329c7b07d15b0d5f44505ce7ecd /apps/plugins/pdbox/PDa/src | |
| parent | 2438d8b58467d9498ab2009636d3df50447390bc (diff) | |
| download | rockbox-2e5b1b1a9cab0ff19170815fda13f40268126027.zip rockbox-2e5b1b1a9cab0ff19170815fda13f40268126027.tar.gz rockbox-2e5b1b1a9cab0ff19170815fda13f40268126027.tar.bz2 rockbox-2e5b1b1a9cab0ff19170815fda13f40268126027.tar.xz | |
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')
| -rw-r--r-- | apps/plugins/pdbox/PDa/src/m_fixed.h | 16 |
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 aa7b74b..57c9296 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; /* 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 */ |