From 53ce9e87fa11300647020ab6dd0a964ce0ff5a19 Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 16 Oct 2002 09:07:00 +0000 Subject: Nicolas Pitre's LOW_ACCURACY patch git-svn-id: https://svn.xiph.org/trunk/Tremor@4012 0101bb08-14d6-0310-b084-bc0e0c8e3800 --- asm_arm.h | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'asm_arm.h') diff --git a/asm_arm.h b/asm_arm.h index e8a718f..3a3716d 100644 --- a/asm_arm.h +++ b/asm_arm.h @@ -16,7 +16,8 @@ ********************************************************************/ #ifdef _ARM_ASSEM_ -#ifndef _V_WIDE_MATH + +#if !defined(_V_WIDE_MATH) && !defined(_LOW_ACCURACY_) #define _V_WIDE_MATH static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { @@ -32,10 +33,6 @@ static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) { return MULT32(x,y)<<1; } -static inline ogg_int32_t MULT30(ogg_int32_t x, ogg_int32_t y) { - return MULT32(x,y)<<2; -} - static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { int lo,hi; asm volatile("smull %0, %1, %2, %3\n\t" @@ -47,19 +44,6 @@ static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { return(hi); } -static inline ogg_int32_t CLIP_TO_15(ogg_int32_t x) { - int tmp; - asm volatile("subs %1, %0, #32768\n\t" - "movpl %0, #0x7f00\n\t" - "orrpl %0, %0, #0xff\n" - "adds %1, %0, #32768\n\t" - "movmi %0, #0x8000" - : "+r"(x),"=r"(tmp) - : - : "cc"); - return(x); -} - #define MB() asm volatile ("" : : : "memory") static inline void XPROD32(ogg_int32_t a, ogg_int32_t b, @@ -118,6 +102,24 @@ static inline void XNPROD31(ogg_int32_t a, ogg_int32_t b, #endif +#ifndef _V_CLIP_MATH +#define _V_CLIP_MATH + +static inline ogg_int32_t CLIP_TO_15(ogg_int32_t x) { + int tmp; + asm volatile("subs %1, %0, #32768\n\t" + "movpl %0, #0x7f00\n\t" + "orrpl %0, %0, #0xff\n" + "adds %1, %0, #32768\n\t" + "movmi %0, #0x8000" + : "+r"(x),"=r"(tmp) + : + : "cc"); + return(x); +} + +#endif + #ifndef _V_LSP_MATH_ASM #define _V_LSP_MATH_ASM @@ -238,3 +240,4 @@ static inline void lsp_norm_asm(ogg_uint32_t *qip,ogg_int32_t *qexpp){ #endif #endif + -- cgit v1.2.1