summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2010-08-05 21:59:29 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2010-08-05 21:59:29 +0000
commit4b49ef2adea6f478c157f398777a7708a45932df (patch)
tree90efa7cd9d8411fbe3c618a63671ac564a74473c
parentcc7fac27b55c4358b2c5d15ab9ee910a6efef314 (diff)
downloadrockbox-4b49ef2adea6f478c157f398777a7708a45932df.tar.gz
rockbox-4b49ef2adea6f478c157f398777a7708a45932df.tar.bz2
rockbox-4b49ef2adea6f478c157f398777a7708a45932df.zip
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
-rw-r--r--apps/codecs/libwmapro/wmapro_math.h7
1 files changed, 3 insertions, 4 deletions
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 */