From 2e5b1b1a9cab0ff19170815fda13f40268126027 Mon Sep 17 00:00:00 2001 From: Wincent Balin Date: Thu, 3 Jun 2010 22:03:37 +0000 Subject: 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 --- apps/plugins/pdbox/PDa/src/m_fixed.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'apps/plugins/pdbox/PDa/src/m_fixed.h') 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; /* 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) #define idiv(a,b) ((((long long) (a) )<