summaryrefslogtreecommitdiff
path: root/apps/codecs/libwma/wmadeci.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-07-04 19:23:18 +0000
committerJens Arnold <amiconn@rockbox.org>2007-07-04 19:23:18 +0000
commite7cdd6cbc6040c3c6225580ba155edfdfd35efb1 (patch)
tree53851e30bee5c1815118b141afe363cd6d63dbf3 /apps/codecs/libwma/wmadeci.c
parentfe8ae10ab41af912bee3d6c5b0dd50ddc74739fa (diff)
downloadrockbox-e7cdd6cbc6040c3c6225580ba155edfdfd35efb1.tar.gz
rockbox-e7cdd6cbc6040c3c6225580ba155edfdfd35efb1.zip
Assemblerised CMUL() for ARM, giving ~20% speedup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13787 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwma/wmadeci.c')
-rw-r--r--apps/codecs/libwma/wmadeci.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c
index 6647ed4b40..29651382e2 100644
--- a/apps/codecs/libwma/wmadeci.c
+++ b/apps/codecs/libwma/wmadeci.c
@@ -50,7 +50,29 @@ uint32_t bswap_32(uint32_t x)
50 return (b1 >> 24) | (b2 >> 8) | (b3 << 8) | (b4 << 24); 50 return (b1 >> 24) | (b2 >> 8) | (b3 << 8) | (b4 << 24);
51} 51}
52 52
53#ifdef CPU_COLDFIRE 53#ifdef CPU_ARM
54static inline
55void CMUL(fixed32 *x, fixed32 *y,
56 fixed32 a, fixed32 b,
57 fixed32 t, fixed32 v)
58{
59 /* This version loses one bit of precision. Could be solved at the cost
60 * of 2 extra cycles if it becomes an issue. */
61 int x1, y1, l;
62 asm(
63 "smull %[l], %[y1], %[b], %[t] \n"
64 "smlal %[l], %[y1], %[a], %[v] \n"
65 "rsb %[b], %[b], #0 \n"
66 "smull %[l], %[x1], %[a], %[t] \n"
67 "smlal %[l], %[x1], %[b], %[v] \n"
68 : [l] "=&r" (l), [x1]"=&r" (x1), [y1]"=&r" (y1), [b] "+r" (b)
69 : [a] "r" (a), [t] "r" (t), [v] "r" (v)
70 : "cc"
71 );
72 *x = x1 << 1;
73 *y = y1 << 1;
74}
75#elif defined CPU_COLDFIRE
54static inline 76static inline
55void CMUL(fixed32 *x, fixed32 *y, 77void CMUL(fixed32 *x, fixed32 *y,
56 fixed32 a, fixed32 b, 78 fixed32 a, fixed32 b,