From ac16071399bcf8cef7c438416163b59374b78b6f Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Tue, 27 Jul 2010 06:30:38 +0000 Subject: 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 --- apps/codecs/libwmapro/wmapro_math.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'apps') 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 */ -- cgit v1.2.3