summaryrefslogtreecommitdiffstats
path: root/package/speex/speex-thumb2-support.patch
blob: b6f7369299a612118afebe587e5f62f7d3b5a7c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
Make speex Thumb2 compatible

Patch written by Michael Hope from Linaro, available at
http://lists.xiph.org/pipermail/speex-dev/2010-November/008041.html.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

diff --git a/libspeex/filters_arm4.h b/libspeex/filters_arm4.h
index 7a74042..6ec1f75 100644
--- a/libspeex/filters_arm4.h
+++ b/libspeex/filters_arm4.h
@@ -47,8 +47,10 @@ int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int le
 
          "\tldr %4, [%0], #4 \n"
          "\tcmps %4, %1 \n"
+         "\tit gt \n"
          "\tmovgt %1, %4 \n"
          "\tcmps %4, %3 \n"
+         "\tit lt \n"
          "\tmovlt %3, %4 \n"
 
          "\tsubs %2, %2, #1 \n"
@@ -56,6 +58,7 @@ int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int le
 
          "\trsb %3, %3, #0 \n"
          "\tcmp %1, %3 \n"
+         "\tit lt \n"
          "\tmovlt %1, %3 \n"
    : "=r" (dead1), "=r" (max_val), "=r" (dead3), "=r" (dead4),
    "=r" (dead5), "=r" (dead6)
diff --git a/libspeex/fixed_arm4.h b/libspeex/fixed_arm4.h
index b6981ca..b6218ca 100644
--- a/libspeex/fixed_arm4.h
+++ b/libspeex/fixed_arm4.h
@@ -69,72 +69,90 @@ static inline short DIV32_16(int a, int b)
    __asm__ __volatile__ (
          "\teor %5, %0, %1\n"
          "\tmovs %4, %0\n"
+         "\tit mi \n"
          "\trsbmi %0, %0, #0 \n"
          "\tmovs %4, %1\n"
+         "\tit mi \n"
          "\trsbmi %1, %1, #0 \n"
          "\tmov %4, #1\n"
 
          "\tsubs %3, %0, %1, asl #14 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #14 \n"
 
          "\tsubs %3, %0, %1, asl #13 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #13 \n"
 
          "\tsubs %3, %0, %1, asl #12 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #12 \n"
 
          "\tsubs %3, %0, %1, asl #11 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #11 \n"
 
          "\tsubs %3, %0, %1, asl #10 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #10 \n"
 
          "\tsubs %3, %0, %1, asl #9 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #9 \n"
 
          "\tsubs %3, %0, %1, asl #8 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #8 \n"
 
          "\tsubs %3, %0, %1, asl #7 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #7 \n"
 
          "\tsubs %3, %0, %1, asl #6 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #6 \n"
          
          "\tsubs %3, %0, %1, asl #5 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #5 \n"
 
          "\tsubs %3, %0, %1, asl #4 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #4 \n"
 
          "\tsubs %3, %0, %1, asl #3 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #3 \n"
 
          "\tsubs %3, %0, %1, asl #2 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #2 \n"
 
          "\tsubs %3, %0, %1, asl #1 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4, asl #1 \n"
 
          "\tsubs %3, %0, %1 \n"
+         "\titt pl \n"
          "\tmovpl %0, %3 \n"
          "\torrpl %2, %2, %4 \n"
 
          "\tmovs %5, %5, lsr #31 \n"
+         "\tit ne \n"
          "\trsbne %2, %2, #0 \n"
    : "=r" (dead1), "=r" (dead2), "=r" (res),
    "=r" (dead3), "=r" (dead4), "=r" (dead5)
diff --git a/libspeex/fixed_arm5e.h b/libspeex/fixed_arm5e.h
index 9b4861c..bdadd02 100644
--- a/libspeex/fixed_arm5e.h
+++ b/libspeex/fixed_arm5e.h
@@ -97,72 +97,90 @@ static inline short DIV32_16(int a, int b)
    __asm__ __volatile__ (
          "\teor %5, %0, %1\n"
          "\tmovs %4, %0\n"
+         "\tit mi \n"
          "\trsbmi %0, %0, #0 \n"
          "\tmovs %4, %1\n"
+         "\tit mi \n"
          "\trsbmi %1, %1, #0 \n"
          "\tmov %4, #1\n"
 
          "\tsubs %3, %0, %1, asl #14 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #14 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #13 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #13 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #12 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #12 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #11 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #11 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #10 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #10 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #9 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #9 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #8 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #8 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #7 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #7 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #6 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #6 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #5 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #5 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #4 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #4 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #3 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #3 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #2 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #2 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1, asl #1 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4, asl #1 \n"
          "\tmovpl %0, %3 \n"
 
          "\tsubs %3, %0, %1 \n"
+         "\titt pl \n"
          "\torrpl %2, %2, %4 \n"
          "\tmovpl %0, %3 \n"
          
          "\tmovs %5, %5, lsr #31 \n"
+         "\tit ne \n"
          "\trsbne %2, %2, #0 \n"
    : "=r" (dead1), "=r" (dead2), "=r" (res),
    "=r" (dead3), "=r" (dead4), "=r" (dead5)