From 5f12af28fb46d3d14e3168a55a34f3267543b312 Mon Sep 17 00:00:00 2001 From: Thom Johansen Date: Sat, 11 Jun 2005 14:45:48 +0000 Subject: Big performance improvement for liba52. A couple of small ASM opts, and lots IRAM usage. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6676 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/liba52/a52_internal.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'apps/codecs/liba52/a52_internal.h') diff --git a/apps/codecs/liba52/a52_internal.h b/apps/codecs/liba52/a52_internal.h index 32b1160903..4de21d9dde 100644 --- a/apps/codecs/liba52/a52_internal.h +++ b/apps/codecs/liba52/a52_internal.h @@ -141,6 +141,31 @@ typedef int16_t quantizer_t; #if 0 #define MUL(a,b) ((int)(((int64_t)(a) * (b) + (1 << 29)) >> 30)) #define MUL_L(a,b) ((int)(((int64_t)(a) * (b) + (1 << 25)) >> 26)) +#elif CONFIG_CPU==MCF5249 && !defined(SIMULATOR) +/* loses 1 bit of accuracy */ +#define MUL(a, b) \ +({ \ + int32_t t; \ + asm volatile ( \ + "mac.l %[A], %[B], %%acc0\n\t" \ + "movclr.l %%acc0, %[t]\n\t" \ + "asl.l #1, %[t]" \ + : [t] "=d" (t) \ + : [A] "r" ((a)), [B] "r" ((b))); \ + t; \ +}) +/* loses 5 bits of accuracy */ +#define MUL_L(a, b) \ +({ \ + int32_t t; \ + asm volatile ( \ + "mac.l %[A], %[B], %%acc0\n\t" \ + "movclr.l %%acc0, %[t]\n\t" \ + "asl.l #5, %[t]" \ + : [t] "=d" (t) \ + : [A] "r" ((a)), [B] "r" ((b))); \ + t; \ +}) #elif 1 #define MUL(a,b) \ ({ int32_t _ta=(a), _tb=(b), _tc; \ -- cgit v1.2.3