summaryrefslogtreecommitdiffstats
path: root/sbc
diff options
context:
space:
mode:
authorBrad Midgley <bmidgley@xmission.com>2008-01-28 17:32:36 +0000
committerBrad Midgley <bmidgley@xmission.com>2008-01-28 17:32:36 +0000
commit05a6e1afb3b0111e8fafcb8ca2d1ca8674390c11 (patch)
treec10e641a54e8dbffe4446a1bcb520b2830a016aa /sbc
parent38158dc5dd8e7c62ad2decfec395e3ec2c7e280b (diff)
arm-assembly from cidoca for MULA
Diffstat (limited to 'sbc')
-rw-r--r--sbc/sbc_math.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sbc/sbc_math.h b/sbc/sbc_math.h
index 625d4dd0..68b0f197 100644
--- a/sbc/sbc_math.h
+++ b/sbc/sbc_math.h
@@ -65,5 +65,13 @@ typedef long long sbc_extended_t;
#define ADD(dst, src) { dst += src; }
#define SUB(dst, src) { dst -= src; }
#define MUL(dst, a, b) { dst = (sbc_extended_t) (a) * (b); }
-#define MULA(dst, a, b) { dst += (sbc_extended_t) (a) * (b); }
#define DIV2(dst, src) { dst = ASR(src, 1); }
+
+#ifdef __arm__
+#define MULA(res, a, b) __asm__( \
+ "smlal %Q0, %R0, %2, %3" \
+ : "=&r" (res) \
+ : "0" (res), "r" (a), "r" (b));
+#else
+#define MULA(dst, a, b) { dst += (sbc_extended_t) (a) * (b); }
+#endif