diff options
author | Brad Midgley <bmidgley@xmission.com> | 2008-01-30 20:39:33 +0000 |
---|---|---|
committer | Brad Midgley <bmidgley@xmission.com> | 2008-01-30 20:39:33 +0000 |
commit | e51de7f6fb5385c9df62842ce9cf92f9fd33f040 (patch) | |
tree | 6fc095a64f41f1f1934789abb027bb2707ef3e49 | |
parent | 82540ead6bfe7d0398256b48500e6fbecb0e28e1 (diff) |
arm assembly version of MULA
-rw-r--r-- | sbc/sbc_math.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 |