summaryrefslogtreecommitdiff
path: root/apps/codecs/lib/asm_arm.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/lib/asm_arm.h')
-rw-r--r--apps/codecs/lib/asm_arm.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/apps/codecs/lib/asm_arm.h b/apps/codecs/lib/asm_arm.h
index 4f31f80c3e..9dcbcef755 100644
--- a/apps/codecs/lib/asm_arm.h
+++ b/apps/codecs/lib/asm_arm.h
@@ -226,14 +226,11 @@ void vect_mult_bw(int32_t *data, int32_t *window, int n)
226#define _V_CLIP_MATH 226#define _V_CLIP_MATH
227 227
228static inline int32_t CLIP_TO_15(int32_t x) { 228static inline int32_t CLIP_TO_15(int32_t x) {
229 int tmp; 229 const int32_t mask = 0xffff7fff;
230 asm volatile("subs %1, %0, #32768\n\t" 230 asm volatile("teq %0,%0,asr #31\n\t"
231 "movpl %0, #0x7f00\n\t" 231 "eorne %0,%1,%0,asr #31\n\t"
232 "orrpl %0, %0, #0xff\n" 232 : "+r"(x)
233 "adds %1, %0, #32768\n\t" 233 : "r" (mask)
234 "movmi %0, #0x8000"
235 : "+r"(x),"=r"(tmp)
236 :
237 : "cc"); 234 : "cc");
238 return(x); 235 return(x);
239} 236}