From 4b49ef2adea6f478c157f398777a7708a45932df Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Thu, 5 Aug 2010 21:59:29 +0000 Subject: Another minor ARM speedup for libwmapro. Drop lsb of multiplication result in fixmul31(). The difference to current implementation is +/-1 in the output signal. Same routines are used for other codecs and in the codec lib as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27728 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libwmapro/wmapro_math.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'apps/codecs/libwmapro/wmapro_math.h') diff --git a/apps/codecs/libwmapro/wmapro_math.h b/apps/codecs/libwmapro/wmapro_math.h index a34a5a8d5a..c78d6b627f 100644 --- a/apps/codecs/libwmapro/wmapro_math.h +++ b/apps/codecs/libwmapro/wmapro_math.h @@ -53,18 +53,17 @@ lo; \ }) - /* Calculates: result = (X*Y)>>31 */ + /* Calculates: result = (X*Y)>>31, loose 1 bit precision */ #define fixmul31(X,Y) \ ({ \ int32_t lo; \ int32_t hi; \ asm volatile ( \ "smull %[lo], %[hi], %[x], %[y] \n\t" /* multiply */ \ - "mov %[lo], %[lo], lsr #31 \n\t" /* lo >>= 31 */ \ - "orr %[lo], %[lo], %[hi], lsl #1" /* lo |= (hi << 1) */ \ + "mov %[hi], %[hi], lsl #1" /* hi <<= 1 */ \ : [lo]"=&r"(lo), [hi]"=&r"(hi) \ : [x]"r"(X), [y]"r"(Y)); \ - lo; \ + hi; \ }) #elif defined(CPU_COLDFIRE) /* Calculates: result = (X*Y)>>Z */ -- cgit v1.2.3