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)
downloadrockbox-ac16071399bcf8cef7c438416163b59374b78b6f.tar.gz
rockbox-ac16071399bcf8cef7c438416163b59374b78b6f.zip
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 @@
111 /* Calculates: result = (X*Y)>>24 */ 111 /* Calculates: result = (X*Y)>>24 */
112 #define fixmul24(X,Y) \ 112 #define fixmul24(X,Y) \
113 ({ \ 113 ({ \
114 int32_t t, x = (X); \ 114 int32_t t1, t2; \
115 asm volatile ( \ 115 asm volatile ( \
116 "mac.l %[x],%[y],%%acc0\n\t" /* multiply */ \ 116 "mac.l %[x],%[y],%%acc0 \n\t" /* multiply */ \
117 "mulu.l %[y],%[x] \n\t" /* get lower half, avoid emac stall */ \ 117 "move.l %%accext01, %[t1]\n\t" /* get lower 8 bits */ \
118 "moveq.l #24,%[t] \n\t" \ 118 "movclr.l %%acc0,%[t2] \n\t" /* get higher 24 bits */ \
119 "lsr.l %[t],%[x] \n\t" /* (unsigned)lo >>= 24 */ \ 119 "asl.l #7,%[t2] \n\t" /* hi <<= 7, plus one free */ \
120 "movclr.l %%acc0,%[t] \n\t" /* get higher half */ \ 120 "move.b %[t1],%[t2] \n\t" /* combine result */ \
121 "asl.l #7,%[t] \n\t" /* hi <<= 7, plus one free */ \ 121 : [t1]"=&d"(t1), [t2]"=&d"(t2) \
122 "or.l %[x],%[t] \n\t" /* combine result */ \ 122 : [x] "d" ((X)), [y] "d" ((Y))); \
123 : [t]"=&d"(t), [x] "+d" (x) \ 123 t2; \
124 : [y] "d" ((Y))); \
125 t; \
126 }) 124 })
127 125
128 /* Calculates: result = (X*Y)>>32 */ 126 /* Calculates: result = (X*Y)>>32 */