From 3ac0fc7c907695d72f58c41907cef913cf81561f Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Sat, 6 Oct 2012 23:41:15 +0200 Subject: opus: cf inline asm for MULT32_32_Q31 speeds up decoding of a 64kbps test file by 2MHz on h300 Change-Id: I437d05278fe1c495715cf0e3477f9960d1df9d3a --- lib/rbcodec/codecs/libopus/celt/fixed_generic.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib/rbcodec/codecs') diff --git a/lib/rbcodec/codecs/libopus/celt/fixed_generic.h b/lib/rbcodec/codecs/libopus/celt/fixed_generic.h index 53f513b67b..28a1598d3e 100644 --- a/lib/rbcodec/codecs/libopus/celt/fixed_generic.h +++ b/lib/rbcodec/codecs/libopus/celt/fixed_generic.h @@ -71,7 +71,19 @@ static inline int32_t MULT16_32_Q15(int32_t a, int32_t b) #define MULT16_32_Q15(a,b) ADD32(SHL(MULT16_16((a),SHR((b),16)),1), SHR(MULT16_16SU((a),((b)&0x0000ffff)),15)) #endif -#if defined(CPU_ARM) +#if defined(CPU_COLDFIRE) +static inline int32_t MULT32_32_Q31(int32_t a, int32_t b) +{ + int32_t r; + asm volatile ("mac.l %[a], %[b], %%acc0;" + "movclr.l %%acc0, %[r];" + : [r] "=r" (r) + : [a] "r" (a), [b] "r" (b) + : "cc"); + return r; +} + +#elif defined(CPU_ARM) static inline int32_t MULT32_32_Q31(int32_t a, int32_t b) { int32_t lo, hi; -- cgit v1.2.3