From 5947e49f467cdf3cf5d2acfcc3c0bd6f97ab29f7 Mon Sep 17 00:00:00 2001 From: Thom Johansen Date: Sat, 28 Jan 2006 21:21:21 +0000 Subject: Make Tremor usable on ARM targets. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8475 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/Tremor/asm_arm.h | 27 +++++++++++---------------- apps/codecs/Tremor/config-tremor.h | 4 ++++ apps/codecs/Tremor/floor0.c | 2 ++ 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/apps/codecs/Tremor/asm_arm.h b/apps/codecs/Tremor/asm_arm.h index 3a3716df1f..e623ce9b3d 100644 --- a/apps/codecs/Tremor/asm_arm.h +++ b/apps/codecs/Tremor/asm_arm.h @@ -46,22 +46,17 @@ static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { #define MB() asm volatile ("" : : : "memory") -static inline void XPROD32(ogg_int32_t a, ogg_int32_t b, - ogg_int32_t t, ogg_int32_t v, - ogg_int32_t *x, ogg_int32_t *y) -{ - int x1, y1, l; - asm( "smull %0, %1, %4, %6\n\t" - "smlal %0, %1, %5, %7\n\t" - "rsb %3, %4, #0\n\t" - "smull %0, %2, %5, %6\n\t" - "smlal %0, %2, %3, %7" - : "=&r" (l), "=&r" (x1), "=&r" (y1), "=r" (a) - : "3" (a), "r" (b), "r" (t), "r" (v) - : "cc" ); - *x = x1; - MB(); - *y = y1; +#define XPROD32(a, b, t, v, x, y) \ +{ \ + long l; \ + asm( "smull %0, %1, %4, %6\n\t" \ + "smlal %0, %1, %5, %7\n\t" \ + "rsb %3, %4, #0\n\t" \ + "smull %0, %2, %5, %6\n\t" \ + "smlal %0, %2, %3, %7" \ + : "=&r" (l), "=&r" (x), "=&r" (y), "=r" ((a)) \ + : "3" ((a)), "r" ((b)), "r" ((t)), "r" ((v)) \ + : "cc" ); \ } static inline void XPROD31(ogg_int32_t a, ogg_int32_t b, diff --git a/apps/codecs/Tremor/config-tremor.h b/apps/codecs/Tremor/config-tremor.h index 402feb5363..f4a0e1c0bf 100644 --- a/apps/codecs/Tremor/config-tremor.h +++ b/apps/codecs/Tremor/config-tremor.h @@ -1,4 +1,8 @@ #include "../codec.h" +#ifdef CPU_ARM +#define _ARM_ASSEM_ +#endif + #ifdef ROCKBOX_BIG_ENDIAN #define BIG_ENDIAN 1 #define LITTLE_ENDIAN 0 diff --git a/apps/codecs/Tremor/floor0.c b/apps/codecs/Tremor/floor0.c index 8ea36aba2a..c412f71ddd 100644 --- a/apps/codecs/Tremor/floor0.c +++ b/apps/codecs/Tremor/floor0.c @@ -173,6 +173,8 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int *map,int n,int ln, ogg_int32_t wi=icos[k]; #ifdef _V_LSP_MATH_ASM + (void)shift; /* kill warnings */ + (void)j; lsp_loop_asm(&qi,&pi,&qexp,ilsp,wi,m); pi=((pi*pi)>>16); -- cgit v1.2.3