summaryrefslogtreecommitdiff
path: root/asm_arm.h
diff options
context:
space:
mode:
authorMonty <xiphmont@xiph.org>2002-10-16 09:07:00 +0000
committerMonty <xiphmont@xiph.org>2002-10-16 09:07:00 +0000
commit53ce9e87fa11300647020ab6dd0a964ce0ff5a19 (patch)
treebab451f9f285a4bd7583a4871af7f34254a0cb25 /asm_arm.h
parent93e8099a940fa6a34d52f027be9956c947c44ba6 (diff)
downloadtremor-53ce9e87fa11300647020ab6dd0a964ce0ff5a19.tar.gz
Nicolas Pitre's LOW_ACCURACY patch
git-svn-id: https://svn.xiph.org/trunk/Tremor@4012 0101bb08-14d6-0310-b084-bc0e0c8e3800
Diffstat (limited to 'asm_arm.h')
-rw-r--r--asm_arm.h39
1 files changed, 21 insertions, 18 deletions
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
+