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