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.h60
1 files changed, 44 insertions, 16 deletions
diff --git a/apps/codecs/lib/asm_arm.h b/apps/codecs/lib/asm_arm.h
index 89606184da..4f31f80c3e 100644
--- a/apps/codecs/lib/asm_arm.h
+++ b/apps/codecs/lib/asm_arm.h
@@ -23,7 +23,7 @@ static inline int32_t MULT32(int32_t x, int32_t y) {
23 int lo,hi; 23 int lo,hi;
24 asm volatile("smull\t%0, %1, %2, %3" 24 asm volatile("smull\t%0, %1, %2, %3"
25 : "=&r"(lo),"=&r"(hi) 25 : "=&r"(lo),"=&r"(hi)
26 : "%r"(x),"r"(y) ); 26 : "r"(x),"r"(y) );
27 return(hi); 27 return(hi);
28} 28}
29 29
@@ -37,7 +37,7 @@ static inline int32_t MULT31_SHIFT15(int32_t x, int32_t y) {
37 "movs %0, %0, lsr #15\n\t" 37 "movs %0, %0, lsr #15\n\t"
38 "adc %1, %0, %1, lsl #17\n\t" 38 "adc %1, %0, %1, lsl #17\n\t"
39 : "=&r"(lo),"=&r"(hi) 39 : "=&r"(lo),"=&r"(hi)
40 : "%r"(x),"r"(y) 40 : "r"(x),"r"(y)
41 : "cc" ); 41 : "cc" );
42 return(hi); 42 return(hi);
43} 43}
@@ -45,13 +45,13 @@ static inline int32_t MULT31_SHIFT15(int32_t x, int32_t y) {
45#define XPROD32(a, b, t, v, x, y) \ 45#define XPROD32(a, b, t, v, x, y) \
46{ \ 46{ \
47 long l; \ 47 long l; \
48 asm( "smull %0, %1, %4, %6\n\t" \ 48 asm( "smull %0, %1, %3, %5\n\t" \
49 "rsb %3, %4, #0\n\t" \ 49 "rsb %2, %6, #0\n\t" \
50 "smlal %0, %1, %5, %7\n\t" \ 50 "smlal %0, %1, %4, %6\n\t" \
51 "smull %0, %2, %5, %6\n\t" \ 51 "smull %0, %2, %3, %2\n\t" \
52 "smlal %0, %2, %3, %7" \ 52 "smlal %0, %2, %4, %5" \
53 : "=&r" (l), "=&r" (x), "=&r" (y), "=r" ((a)) \ 53 : "=&r" (l), "=&r" (x), "=&r" (y) \
54 : "3" ((a)), "r" ((b)), "r" ((t)), "r" ((v)) ); \ 54 : "r" ((a)), "r" ((b)), "r" ((t)), "r" ((v)) ); \
55} 55}
56 56
57static inline void XPROD31(int32_t a, int32_t b, 57static inline void XPROD31(int32_t a, int32_t b,
@@ -59,13 +59,13 @@ static inline void XPROD31(int32_t a, int32_t b,
59 int32_t *x, int32_t *y) 59 int32_t *x, int32_t *y)
60{ 60{
61 int x1, y1, l; 61 int x1, y1, l;
62 asm( "smull %0, %1, %4, %6\n\t" 62 asm( "smull %0, %1, %3, %5\n\t"
63 "rsb %3, %4, #0\n\t" 63 "rsb %2, %6, #0\n\t"
64 "smlal %0, %1, %5, %7\n\t" 64 "smlal %0, %1, %4, %6\n\t"
65 "smull %0, %2, %5, %6\n\t" 65 "smull %0, %2, %3, %2\n\t"
66 "smlal %0, %2, %3, %7" 66 "smlal %0, %2, %4, %5"
67 : "=&r" (l), "=&r" (x1), "=&r" (y1), "=r" (a) 67 : "=&r" (l), "=&r" (x1), "=&r" (y1)
68 : "3" (a), "r" (b), "r" (t), "r" (v) ); 68 : "r" (a), "r" (b), "r" (t), "r" (v) );
69 *x = x1 << 1; 69 *x = x1 << 1;
70 *y = y1 << 1; 70 *y = y1 << 1;
71} 71}
@@ -86,6 +86,34 @@ static inline void XNPROD31(int32_t a, int32_t b,
86 *y = y1 << 1; 86 *y = y1 << 1;
87} 87}
88 88
89#define XPROD31_R(_a, _b, _t, _v, _x, _y)\
90{\
91 int x1, y1, l;\
92 asm( "smull %0, %1, %5, %3\n\t"\
93 "rsb %2, %3, #0\n\t"\
94 "smlal %0, %1, %6, %4\n\t"\
95 "smull %0, %2, %6, %2\n\t"\
96 "smlal %0, %2, %5, %4"\
97 : "=&r" (l), "=&r" (x1), "=&r" (y1)\
98 : "r" (_a), "r" (_b), "r" (_t), "r" (_v) );\
99 _x = x1 << 1;\
100 _y = y1 << 1;\
101}
102
103#define XNPROD31_R(_a, _b, _t, _v, _x, _y)\
104{\
105 int x1, y1, l;\
106 asm( "smull %0, %1, %5, %3\n\t"\
107 "rsb %2, %4, #0\n\t"\
108 "smlal %0, %1, %6, %2\n\t"\
109 "smull %0, %2, %5, %4\n\t"\
110 "smlal %0, %2, %6, %3"\
111 : "=&r" (l), "=&r" (x1), "=&r" (y1)\
112 : "r" (_a), "r" (_b), "r" (_t), "r" (_v) );\
113 _x = x1 << 1;\
114 _y = y1 << 1;\
115}
116
89#ifndef _V_VECT_OPS 117#ifndef _V_VECT_OPS
90#define _V_VECT_OPS 118#define _V_VECT_OPS
91 119