summaryrefslogtreecommitdiff
path: root/apps/codecs/libmusepack
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2010-05-29 14:56:25 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2010-05-29 14:56:25 +0000
commit9ab57e510e5ff64c5ce3d6bf47d7bf1ff8261e01 (patch)
tree64b75043581d949accee5c9cdaec74275ed6ec74 /apps/codecs/libmusepack
parent56220785c11d9ad62b552a8f1ba44d779d5edf48 (diff)
downloadrockbox-9ab57e510e5ff64c5ce3d6bf47d7bf1ff8261e01.zip
rockbox-9ab57e510e5ff64c5ce3d6bf47d7bf1ff8261e01.tar.gz
rockbox-9ab57e510e5ff64c5ce3d6bf47d7bf1ff8261e01.tar.bz2
rockbox-9ab57e510e5ff64c5ce3d6bf47d7bf1ff8261e01.tar.xz
Small changes to asm for better readability.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26375 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libmusepack')
-rw-r--r--apps/codecs/libmusepack/mpcdec_math.h56
1 files changed, 28 insertions, 28 deletions
diff --git a/apps/codecs/libmusepack/mpcdec_math.h b/apps/codecs/libmusepack/mpcdec_math.h
index 55295db..bb79a52 100644
--- a/apps/codecs/libmusepack/mpcdec_math.h
+++ b/apps/codecs/libmusepack/mpcdec_math.h
@@ -115,32 +115,32 @@
return t1;
}
#elif defined(CPU_ARM)
- // borrowed and adapted from libMAD
+ /* Calculate: result = (X*Y)>>14 */
#define MPC_MULTIPLY(X,Y) \
({ \
- MPC_SAMPLE_FORMAT low; \
- MPC_SAMPLE_FORMAT high; \
- asm volatile ( /* will calculate: result = (X*Y)>>14 */ \
- "smull %0,%1,%2,%3 \n\t" /* multiply with result %0 [0..31], %1 [32..63] */ \
- "mov %0, %0, lsr #14 \n\t" /* %0 = %0 >> 14 */ \
- "orr %0, %0, %1, lsl #18 \n\t"/* result = %0 OR (%1 << 18) */ \
- : "=&r"(low), "=&r" (high) \
- : "r"(X),"r"(Y)); \
- low; \
+ MPC_SAMPLE_FORMAT lo; \
+ MPC_SAMPLE_FORMAT hi; \
+ asm volatile ( \
+ "smull %[lo], %[hi], %[x], %[y] \n\t" /* multiply */ \
+ "mov %[lo], %[lo], lsr #14 \n\t" /* lo >>= 14 */ \
+ "orr %[lo], %[lo], %[hi], lsl #18" /* lo |= (hi << 18) */ \
+ : [lo]"=&r"(lo), [hi]"=&r"(hi) \
+ : [x]"r"(X), [y]"r"(Y)); \
+ lo; \
})
- // borrowed and adapted from libMAD
+ /* Calculate: result = (X*Y)>>Z */
#define MPC_MULTIPLY_EX(X,Y,Z) \
({ \
- MPC_SAMPLE_FORMAT low; \
- MPC_SAMPLE_FORMAT high; \
- asm volatile ( /* will calculate: result = (X*Y)>>Z */ \
- "smull %0,%1,%2,%3 \n\t" /* multiply with result %0 [0..31], %1 [32..63] */ \
- "mov %0, %0, lsr %4 \n\t" /* %0 = %0 >> Z */ \
- "orr %0, %0, %1, lsl %5 \n\t" /* result = %0 OR (%1 << (32-Z)) */ \
- : "=&r"(low), "=&r" (high) \
- : "r"(X),"r"(Y),"r"(Z),"r"(32-Z)); \
- low; \
+ MPC_SAMPLE_FORMAT lo; \
+ MPC_SAMPLE_FORMAT hi; \
+ asm volatile ( \
+ "smull %[lo], %[hi], %[x], %[y] \n\t" /* multiply */ \
+ "mov %[lo], %[lo], lsr %[shr] \n\t" /* lo >>= Z */ \
+ "orr %[lo], %[lo], %[hi], lsl %[shl]" /* lo |= (hi << (32-Z)) */ \
+ : [lo]"=&r"(lo), [hi]"=&r"(hi) \
+ : [x]"r"(X), [y]"r"(Y), [shr]"r"(Z), [shl]"r"(32-Z)); \
+ lo; \
})
#else /* libmusepack standard */
@@ -188,16 +188,16 @@
t; \
})
#elif defined(CPU_ARM)
- // borrowed and adapted from libMAD
+ /* Calculate: result = (X*Y)>>32, without need for >>32 */
#define MPC_MULTIPLY_FRACT(X,Y) \
({ \
- MPC_SAMPLE_FORMAT low; \
- MPC_SAMPLE_FORMAT high; \
- asm volatile ( /* will calculate: result = (X*Y)>>32 */ \
- "smull %0,%1,%2,%3 \n\t" /* multiply with result %0 [0..31], %1 [32..63] */ \
- : "=&r"(low), "=&r" (high) /* result = %1 [32..63], saves the >>32 */ \
- : "r"(X),"r"(Y)); \
- high; \
+ MPC_SAMPLE_FORMAT lo; \
+ MPC_SAMPLE_FORMAT hi; \
+ asm volatile ( \
+ "smull %[lo], %[hi], %[x], %[y]" /* hi = result */ \
+ : [lo]"=&r"(lo), [hi]"=&r"(hi) \
+ : [x]"r"(X), [y]"r"(Y)); \
+ hi; \
})
#else
#define MPC_MULTIPLY_FRACT(X,Y) MPC_MULTIPLY_EX(X,Y,32)