summaryrefslogtreecommitdiff
path: root/apps/codecs/libtremor/asm_arm.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libtremor/asm_arm.h')
-rw-r--r--apps/codecs/libtremor/asm_arm.h82
1 files changed, 41 insertions, 41 deletions
diff --git a/apps/codecs/libtremor/asm_arm.h b/apps/codecs/libtremor/asm_arm.h
index 577dc91566..8da7ed75cc 100644
--- a/apps/codecs/libtremor/asm_arm.h
+++ b/apps/codecs/libtremor/asm_arm.h
@@ -34,55 +34,55 @@ static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
34 34
35static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { 35static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
36 int lo,hi; 36 int lo,hi;
37 asm volatile("smull %0, %1, %2, %3\n\t" 37 asm volatile("smull %0, %1, %2, %3\n\t"
38 "movs %0, %0, lsr #15\n\t" 38 "movs %0, %0, lsr #15\n\t"
39 "adc %1, %0, %1, lsl #17\n\t" 39 "adc %1, %0, %1, lsl #17\n\t"
40 : "=&r"(lo),"=&r"(hi) 40 : "=&r"(lo),"=&r"(hi)
41 : "%r"(x),"r"(y) 41 : "%r"(x),"r"(y)
42 : "cc"); 42 : "cc");
43 return(hi); 43 return(hi);
44} 44}
45 45
46#define XPROD32(a, b, t, v, x, y) \ 46#define XPROD32(a, b, t, v, x, y) \
47{ \ 47{ \
48 long l; \ 48 long l; \
49 asm( "smull %0, %1, %4, %6\n\t" \ 49 asm( "smull %0, %1, %4, %6\n\t" \
50 "rsb %3, %4, #0\n\t" \ 50 "rsb %3, %4, #0\n\t" \
51 "smlal %0, %1, %5, %7\n\t" \ 51 "smlal %0, %1, %5, %7\n\t" \
52 "smull %0, %2, %5, %6\n\t" \ 52 "smull %0, %2, %5, %6\n\t" \
53 "smlal %0, %2, %3, %7" \ 53 "smlal %0, %2, %3, %7" \
54 : "=&r" (l), "=&r" (x), "=&r" (y), "=r" ((a)) \ 54 : "=&r" (l), "=&r" (x), "=&r" (y), "=r" ((a)) \
55 : "3" ((a)), "r" ((b)), "r" ((t)), "r" ((v)) ); \ 55 : "3" ((a)), "r" ((b)), "r" ((t)), "r" ((v)) ); \
56} 56}
57 57
58static inline void XPROD31(ogg_int32_t a, ogg_int32_t b, 58static inline void XPROD31(ogg_int32_t a, ogg_int32_t b,
59 ogg_int32_t t, ogg_int32_t v, 59 ogg_int32_t t, ogg_int32_t v,
60 ogg_int32_t *x, ogg_int32_t *y) 60 ogg_int32_t *x, ogg_int32_t *y)
61{ 61{
62 int x1, y1, l; 62 int x1, y1, l;
63 asm( "smull %0, %1, %4, %6\n\t" 63 asm( "smull %0, %1, %4, %6\n\t"
64 "rsb %3, %4, #0\n\t" 64 "rsb %3, %4, #0\n\t"
65 "smlal %0, %1, %5, %7\n\t" 65 "smlal %0, %1, %5, %7\n\t"
66 "smull %0, %2, %5, %6\n\t" 66 "smull %0, %2, %5, %6\n\t"
67 "smlal %0, %2, %3, %7" 67 "smlal %0, %2, %3, %7"
68 : "=&r" (l), "=&r" (x1), "=&r" (y1), "=r" (a) 68 : "=&r" (l), "=&r" (x1), "=&r" (y1), "=r" (a)
69 : "3" (a), "r" (b), "r" (t), "r" (v) ); 69 : "3" (a), "r" (b), "r" (t), "r" (v) );
70 *x = x1 << 1; 70 *x = x1 << 1;
71 *y = y1 << 1; 71 *y = y1 << 1;
72} 72}
73 73
74static inline void XNPROD31(ogg_int32_t a, ogg_int32_t b, 74static inline void XNPROD31(ogg_int32_t a, ogg_int32_t b,
75 ogg_int32_t t, ogg_int32_t v, 75 ogg_int32_t t, ogg_int32_t v,
76 ogg_int32_t *x, ogg_int32_t *y) 76 ogg_int32_t *x, ogg_int32_t *y)
77{ 77{
78 int x1, y1, l; 78 int x1, y1, l;
79 asm( "smull %0, %1, %3, %5\n\t" 79 asm( "smull %0, %1, %3, %5\n\t"
80 "rsb %2, %4, #0\n\t" 80 "rsb %2, %4, #0\n\t"
81 "smlal %0, %1, %2, %6\n\t" 81 "smlal %0, %1, %2, %6\n\t"
82 "smull %0, %2, %4, %5\n\t" 82 "smull %0, %2, %4, %5\n\t"
83 "smlal %0, %2, %3, %6" 83 "smlal %0, %2, %3, %6"
84 : "=&r" (l), "=&r" (x1), "=&r" (y1) 84 : "=&r" (l), "=&r" (x1), "=&r" (y1)
85 : "r" (a), "r" (b), "r" (t), "r" (v) ); 85 : "r" (a), "r" (b), "r" (t), "r" (v) );
86 *x = x1 << 1; 86 *x = x1 << 1;
87 *y = y1 << 1; 87 *y = y1 << 1;
88} 88}
@@ -216,14 +216,14 @@ static inline void vect_copy(ogg_int32_t *x, const ogg_int32_t *y, int n)
216 216
217static inline ogg_int32_t CLIP_TO_15(ogg_int32_t x) { 217static inline ogg_int32_t CLIP_TO_15(ogg_int32_t x) {
218 int tmp; 218 int tmp;
219 asm volatile("subs %1, %0, #32768\n\t" 219 asm volatile("subs %1, %0, #32768\n\t"
220 "movpl %0, #0x7f00\n\t" 220 "movpl %0, #0x7f00\n\t"
221 "orrpl %0, %0, #0xff\n" 221 "orrpl %0, %0, #0xff\n"
222 "adds %1, %0, #32768\n\t" 222 "adds %1, %0, #32768\n\t"
223 "movmi %0, #0x8000" 223 "movmi %0, #0x8000"
224 : "+r"(x),"=r"(tmp) 224 : "+r"(x),"=r"(tmp)
225 : 225 :
226 : "cc"); 226 : "cc");
227 return(x); 227 return(x);
228} 228}
229 229
@@ -233,9 +233,9 @@ static inline ogg_int32_t CLIP_TO_15(ogg_int32_t x) {
233#define _V_LSP_MATH_ASM 233#define _V_LSP_MATH_ASM
234 234
235static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip, 235static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip,
236 ogg_int32_t *qexpp, 236 ogg_int32_t *qexpp,
237 ogg_int32_t *ilsp,ogg_int32_t wi, 237 ogg_int32_t *ilsp,ogg_int32_t wi,
238 ogg_int32_t m){ 238 ogg_int32_t m){
239 239
240 ogg_uint32_t qi=*qip,pi=*pip; 240 ogg_uint32_t qi=*qip,pi=*pip;
241 ogg_int32_t qexp=*qexpp; 241 ogg_int32_t qexp=*qexpp;
@@ -291,7 +291,7 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip,
291 //qexp+=shift; 291 //qexp+=shift;
292 292
293 //} 293 //}
294 294
295 /* normalize to max 16 sig figs */ 295 /* normalize to max 16 sig figs */
296 "2:" 296 "2:"
297 "mov r2,#0;" 297 "mov r2,#0;"