summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-07-27 06:30:38 +0000
committerNils Wallménius <nils@rockbox.org>2010-07-27 06:30:38 +0000
commitac16071399bcf8cef7c438416163b59374b78b6f (patch)
tree0dfc997e8ad947acfd975aab52e5373376199dd2
parent30d286d859aad049fb549f48080a196f6074a9fa (diff)
libwmapro: tiny tweak fo coldfire fixmul24 for a very slight speedup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27585 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/libwmapro/wmapro_math.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/apps/codecs/libwmapro/wmapro_math.h b/apps/codecs/libwmapro/wmapro_math.h
index 5220560998..ba6421c9f5 100644
--- a/apps/codecs/libwmapro/wmapro_math.h
+++ b/apps/codecs/libwmapro/wmapro_math.h
@@ -111,18 +111,16 @@
/* Calculates: result = (X*Y)>>24 */
#define fixmul24(X,Y) \
({ \
- int32_t t, x = (X); \
+ int32_t t1, t2; \
asm volatile ( \
- "mac.l %[x],%[y],%%acc0\n\t" /* multiply */ \
- "mulu.l %[y],%[x] \n\t" /* get lower half, avoid emac stall */ \
- "moveq.l #24,%[t] \n\t" \
- "lsr.l %[t],%[x] \n\t" /* (unsigned)lo >>= 24 */ \
- "movclr.l %%acc0,%[t] \n\t" /* get higher half */ \
- "asl.l #7,%[t] \n\t" /* hi <<= 7, plus one free */ \
- "or.l %[x],%[t] \n\t" /* combine result */ \
- : [t]"=&d"(t), [x] "+d" (x) \
- : [y] "d" ((Y))); \
- t; \
+ "mac.l %[x],%[y],%%acc0 \n\t" /* multiply */ \
+ "move.l %%accext01, %[t1]\n\t" /* get lower 8 bits */ \
+ "movclr.l %%acc0,%[t2] \n\t" /* get higher 24 bits */ \
+ "asl.l #7,%[t2] \n\t" /* hi <<= 7, plus one free */ \
+ "move.b %[t1],%[t2] \n\t" /* combine result */ \
+ : [t1]"=&d"(t1), [t2]"=&d"(t2) \
+ : [x] "d" ((X)), [y] "d" ((Y))); \
+ t2; \
})
/* Calculates: result = (X*Y)>>32 */