From e51de7f6fb5385c9df62842ce9cf92f9fd33f040 Mon Sep 17 00:00:00 2001 From: Brad Midgley Date: Wed, 30 Jan 2008 20:39:33 +0000 Subject: arm assembly version of MULA --- sbc/sbc_math.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sbc/sbc_math.h b/sbc/sbc_math.h index 9aa8c366..8db67ca8 100644 --- a/sbc/sbc_math.h +++ b/sbc/sbc_math.h @@ -63,4 +63,14 @@ typedef long long sbc_extended_t; #define SBC_FIXED_0(val) { val = 0; } #define MUL(a, b) ((sbc_extended_t)(a) * (b)) +#ifdef __arm__ +#define MULA(a, b, res) ({ \ + long long tmp = res; \ + __asm__( \ + "smlal %Q0, %R0, %2, %3" \ + : "=&r" (tmp) \ + : "0" (tmp), "r" (a), "r" (b)); \ + tmp; }) +#else #define MULA(a, b, res) ((sbc_extended_t)(a) * (b) + (res)) +#endif -- cgit