1 Make speex Thumb2 compatible
3 Patch written by Michael Hope from Linaro, available at
4 http://lists.xiph.org/pipermail/speex-dev/2010-November/008041.html.
6 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8 diff --git a/libspeex/filters_arm4.h b/libspeex/filters_arm4.h
9 index 7a74042..6ec1f75 100644
10 --- a/libspeex/filters_arm4.h
11 +++ b/libspeex/filters_arm4.h
12 @@ -47,8 +47,10 @@ int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int le
14 "\tldr %4, [%0], #4 \n"
22 "\tsubs %2, %2, #1 \n"
23 @@ -56,6 +58,7 @@ int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int le
29 : "=r" (dead1), "=r" (max_val), "=r" (dead3), "=r" (dead4),
30 "=r" (dead5), "=r" (dead6)
31 diff --git a/libspeex/fixed_arm4.h b/libspeex/fixed_arm4.h
32 index b6981ca..b6218ca 100644
33 --- a/libspeex/fixed_arm4.h
34 +++ b/libspeex/fixed_arm4.h
35 @@ -69,72 +69,90 @@ static inline short DIV32_16(int a, int b)
36 __asm__ __volatile__ (
40 "\trsbmi %0, %0, #0 \n"
43 "\trsbmi %1, %1, #0 \n"
46 "\tsubs %3, %0, %1, asl #14 \n"
49 "\torrpl %2, %2, %4, asl #14 \n"
51 "\tsubs %3, %0, %1, asl #13 \n"
54 "\torrpl %2, %2, %4, asl #13 \n"
56 "\tsubs %3, %0, %1, asl #12 \n"
59 "\torrpl %2, %2, %4, asl #12 \n"
61 "\tsubs %3, %0, %1, asl #11 \n"
64 "\torrpl %2, %2, %4, asl #11 \n"
66 "\tsubs %3, %0, %1, asl #10 \n"
69 "\torrpl %2, %2, %4, asl #10 \n"
71 "\tsubs %3, %0, %1, asl #9 \n"
74 "\torrpl %2, %2, %4, asl #9 \n"
76 "\tsubs %3, %0, %1, asl #8 \n"
79 "\torrpl %2, %2, %4, asl #8 \n"
81 "\tsubs %3, %0, %1, asl #7 \n"
84 "\torrpl %2, %2, %4, asl #7 \n"
86 "\tsubs %3, %0, %1, asl #6 \n"
89 "\torrpl %2, %2, %4, asl #6 \n"
91 "\tsubs %3, %0, %1, asl #5 \n"
94 "\torrpl %2, %2, %4, asl #5 \n"
96 "\tsubs %3, %0, %1, asl #4 \n"
99 "\torrpl %2, %2, %4, asl #4 \n"
101 "\tsubs %3, %0, %1, asl #3 \n"
104 "\torrpl %2, %2, %4, asl #3 \n"
106 "\tsubs %3, %0, %1, asl #2 \n"
109 "\torrpl %2, %2, %4, asl #2 \n"
111 "\tsubs %3, %0, %1, asl #1 \n"
114 "\torrpl %2, %2, %4, asl #1 \n"
116 "\tsubs %3, %0, %1 \n"
119 "\torrpl %2, %2, %4 \n"
121 "\tmovs %5, %5, lsr #31 \n"
123 "\trsbne %2, %2, #0 \n"
124 : "=r" (dead1), "=r" (dead2), "=r" (res),
125 "=r" (dead3), "=r" (dead4), "=r" (dead5)
126 diff --git a/libspeex/fixed_arm5e.h b/libspeex/fixed_arm5e.h
127 index 9b4861c..bdadd02 100644
128 --- a/libspeex/fixed_arm5e.h
129 +++ b/libspeex/fixed_arm5e.h
130 @@ -97,72 +97,90 @@ static inline short DIV32_16(int a, int b)
131 __asm__ __volatile__ (
135 "\trsbmi %0, %0, #0 \n"
138 "\trsbmi %1, %1, #0 \n"
141 "\tsubs %3, %0, %1, asl #14 \n"
143 "\torrpl %2, %2, %4, asl #14 \n"
146 "\tsubs %3, %0, %1, asl #13 \n"
148 "\torrpl %2, %2, %4, asl #13 \n"
151 "\tsubs %3, %0, %1, asl #12 \n"
153 "\torrpl %2, %2, %4, asl #12 \n"
156 "\tsubs %3, %0, %1, asl #11 \n"
158 "\torrpl %2, %2, %4, asl #11 \n"
161 "\tsubs %3, %0, %1, asl #10 \n"
163 "\torrpl %2, %2, %4, asl #10 \n"
166 "\tsubs %3, %0, %1, asl #9 \n"
168 "\torrpl %2, %2, %4, asl #9 \n"
171 "\tsubs %3, %0, %1, asl #8 \n"
173 "\torrpl %2, %2, %4, asl #8 \n"
176 "\tsubs %3, %0, %1, asl #7 \n"
178 "\torrpl %2, %2, %4, asl #7 \n"
181 "\tsubs %3, %0, %1, asl #6 \n"
183 "\torrpl %2, %2, %4, asl #6 \n"
186 "\tsubs %3, %0, %1, asl #5 \n"
188 "\torrpl %2, %2, %4, asl #5 \n"
191 "\tsubs %3, %0, %1, asl #4 \n"
193 "\torrpl %2, %2, %4, asl #4 \n"
196 "\tsubs %3, %0, %1, asl #3 \n"
198 "\torrpl %2, %2, %4, asl #3 \n"
201 "\tsubs %3, %0, %1, asl #2 \n"
203 "\torrpl %2, %2, %4, asl #2 \n"
206 "\tsubs %3, %0, %1, asl #1 \n"
208 "\torrpl %2, %2, %4, asl #1 \n"
211 "\tsubs %3, %0, %1 \n"
213 "\torrpl %2, %2, %4 \n"
216 "\tmovs %5, %5, lsr #31 \n"
218 "\trsbne %2, %2, #0 \n"
219 : "=r" (dead1), "=r" (dead2), "=r" (res),
220 "=r" (dead3), "=r" (dead4), "=r" (dead5)