From 42774d3128b91d5a37344cb40d56d3c4d147e5f2 Mon Sep 17 00:00:00 2001 From: Dave Hooper Date: Wed, 17 Feb 2010 00:49:53 +0000 Subject: Merge from branches/mdctexp - faster ifft+imdct in codec lib git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24712 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libwma/wmafixed.h | 45 ++++++------------------------------------- 1 file changed, 6 insertions(+), 39 deletions(-) (limited to 'apps/codecs/libwma/wmafixed.h') diff --git a/apps/codecs/libwma/wmafixed.h b/apps/codecs/libwma/wmafixed.h index 6b5137e044..0ecdc5cfbc 100644 --- a/apps/codecs/libwma/wmafixed.h +++ b/apps/codecs/libwma/wmafixed.h @@ -52,10 +52,10 @@ fixed64 fixdiv64(fixed64 x, fixed64 y); fixed32 fixsqrt32(fixed32 x); long fsincos(unsigned long phase, fixed32 *cos); + #ifdef CPU_ARM /*Sign-15.16 format */ - #define fixmul32(x, y) \ ({ int32_t __hi; \ uint32_t __lo; \ @@ -70,18 +70,6 @@ long fsincos(unsigned long phase, fixed32 *cos); __result; \ }) -#define fixmul32b(x, y) \ - ({ int32_t __hi; \ - uint32_t __lo; \ - int32_t __result; \ - asm ("smull %0, %1, %3, %4\n\t" \ - "movs %2, %1, lsl #1" \ - : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \ - : "%r" (x), "r" (y) \ - : "cc"); \ - __result; \ - }) - #elif defined(CPU_COLDFIRE) static inline int32_t fixmul32(int32_t x, int32_t y) @@ -91,9 +79,9 @@ static inline int32_t fixmul32(int32_t x, int32_t y) #endif int32_t t1; asm ( - "mac.l %[x], %[y], %%acc0 \n" /* multiply */ - "mulu.l %[y], %[x] \n" /* get lower half, avoid emac stall */ - "movclr.l %%acc0, %[t1] \n" /* get higher half */ + "mac.l %[x], %[y], %%acc0 \n" // multiply + "mulu.l %[y], %[x] \n" // get lower half, avoid emac stall + "movclr.l %%acc0, %[t1] \n" // get higher half "lsr.l #1, %[t1] \n" "move.w %[t1], %[x] \n" "swap %[x] \n" @@ -103,17 +91,6 @@ static inline int32_t fixmul32(int32_t x, int32_t y) return x; } -static inline int32_t fixmul32b(int32_t x, int32_t y) -{ - asm ( - "mac.l %[x], %[y], %%acc0 \n" /* multiply */ - "movclr.l %%acc0, %[x] \n" /* get higher half */ - : [x] "+d" (x) - : [y] "d" (y) - ); - return x; -} - #else static inline fixed32 fixmul32(fixed32 x, fixed32 y) @@ -127,17 +104,7 @@ static inline fixed32 fixmul32(fixed32 x, fixed32 y) return (fixed32)temp; } -static inline fixed32 fixmul32b(fixed32 x, fixed32 y) -{ - fixed64 temp; - - temp = x; - temp *= y; - - temp >>= 31; //16+31-16 = 31 bits - - return (fixed32)temp; -} - #endif + +/* get fixmul32b from codeclib */ -- cgit v1.2.3