diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-08-05 21:59:29 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-08-05 21:59:29 +0000 |
commit | 4b49ef2adea6f478c157f398777a7708a45932df (patch) | |
tree | 90efa7cd9d8411fbe3c618a63671ac564a74473c | |
parent | cc7fac27b55c4358b2c5d15ab9ee910a6efef314 (diff) | |
download | rockbox-4b49ef2adea6f478c157f398777a7708a45932df.tar.gz 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.h | 7 |
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 @@ | |||
53 | lo; \ | 53 | lo; \ |
54 | }) | 54 | }) |
55 | 55 | ||
56 | /* Calculates: result = (X*Y)>>31 */ | 56 | /* Calculates: result = (X*Y)>>31, loose 1 bit precision */ |
57 | #define fixmul31(X,Y) \ | 57 | #define fixmul31(X,Y) \ |
58 | ({ \ | 58 | ({ \ |
59 | int32_t lo; \ | 59 | int32_t lo; \ |
60 | int32_t hi; \ | 60 | int32_t hi; \ |
61 | asm volatile ( \ | 61 | asm volatile ( \ |
62 | "smull %[lo], %[hi], %[x], %[y] \n\t" /* multiply */ \ | 62 | "smull %[lo], %[hi], %[x], %[y] \n\t" /* multiply */ \ |
63 | "mov %[lo], %[lo], lsr #31 \n\t" /* lo >>= 31 */ \ | 63 | "mov %[hi], %[hi], lsl #1" /* hi <<= 1 */ \ |
64 | "orr %[lo], %[lo], %[hi], lsl #1" /* lo |= (hi << 1) */ \ | ||
65 | : [lo]"=&r"(lo), [hi]"=&r"(hi) \ | 64 | : [lo]"=&r"(lo), [hi]"=&r"(hi) \ |
66 | : [x]"r"(X), [y]"r"(Y)); \ | 65 | : [x]"r"(X), [y]"r"(Y)); \ |
67 | lo; \ | 66 | hi; \ |
68 | }) | 67 | }) |
69 | #elif defined(CPU_COLDFIRE) | 68 | #elif defined(CPU_COLDFIRE) |
70 | /* Calculates: result = (X*Y)>>Z */ | 69 | /* Calculates: result = (X*Y)>>Z */ |