summaryrefslogtreecommitdiff
path: root/apps/codecs/Tremor/mdct_arm.S
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/Tremor/mdct_arm.S')
-rw-r--r--apps/codecs/Tremor/mdct_arm.S429
1 files changed, 0 insertions, 429 deletions
diff --git a/apps/codecs/Tremor/mdct_arm.S b/apps/codecs/Tremor/mdct_arm.S
deleted file mode 100644
index f7858f2e4d..0000000000
--- a/apps/codecs/Tremor/mdct_arm.S
+++ /dev/null
@@ -1,429 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: $
9 *
10 * Copyright (C) 2007 by Tomasz Malesinski
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "config.h"
23/* Codecs should not normally do this, but we need to check a macro, and
24 * codecs.h would confuse the assembler. */
25
26#define cPI3_8 (0x30fbc54d)
27#define cPI2_8 (0x5a82799a)
28#define cPI1_8 (0x7641af3d)
29
30#ifdef USE_IRAM
31 .section .icode,"ax",%progbits
32#else
33 .text
34#endif
35 .align
36
37 .global mdct_butterfly_32
38 .global mdct_butterfly_generic_loop
39
40mdct_butterfly_8:
41 add r9, r5, r1 @ x4 + x0
42 sub r5, r5, r1 @ x4 - x0
43 add r7, r6, r2 @ x5 + x1
44 sub r6, r6, r2 @ x5 - x1
45 add r8, r10, r3 @ x6 + x2
46 sub r10, r10, r3 @ x6 - x2
47 add r12, r11, r4 @ x7 + x3
48 sub r11, r11, r4 @ x7 - x3
49
50 add r1, r10, r6 @ y0 = (x6 - x2) + (x5 - x1)
51 sub r2, r11, r5 @ y1 = (x7 - x3) - (x4 - x0)
52 sub r3, r10, r6 @ y2 = (x6 - x2) - (x5 - x1)
53 add r4, r11, r5 @ y3 = (x7 - x3) + (x4 - x0)
54 sub r5, r8, r9 @ y4 = (x6 + x2) - (x4 + x0)
55 sub r6, r12, r7 @ y5 = (x7 + x3) - (x5 + x1)
56 add r10, r8, r9 @ y6 = (x6 + x2) + (x4 + x0)
57 add r11, r12, r7 @ y7 = (x7 + x3) + (x5 + x1)
58 stmia r0, {r1, r2, r3, r4, r5, r6, r10, r11}
59
60 mov pc, lr
61
62mdct_butterfly_16:
63 str lr, [sp, #-4]!
64 add r1, r0, #8*4
65
66 ldmia r0, {r2, r3, r4, r5}
67 ldmia r1, {r6, r7, r8, r9}
68 add r6, r6, r2 @ y8 = x8 + x0
69 rsb r2, r6, r2, asl #1 @ x0 - x8
70 add r7, r7, r3 @ y9 = x9 + x1
71 rsb r3, r7, r3, asl #1 @ x1 - x9
72 add r8, r8, r4 @ y10 = x10 + x2
73 sub r11, r8, r4, asl #1 @ x10 - x2
74 add r9, r9, r5 @ y11 = x11 + x3
75 rsb r10, r9, r5, asl #1 @ x3 - x11
76
77 stmia r1!, {r6, r7, r8, r9}
78
79 add r2, r2, r3 @ (x0 - x8) + (x1 - x9)
80 rsb r3, r2, r3, asl #1 @ (x1 - x9) - (x0 - x8)
81
82 ldr r12, =cPI2_8
83 smull r8, r5, r2, r12
84 mov r5, r5, asl #1
85 smull r8, r6, r3, r12
86 mov r6, r6, asl #1
87
88 stmia r0!, {r5, r6, r10, r11}
89
90 ldmia r0, {r2, r3, r4, r5}
91 ldmia r1, {r6, r7, r8, r9}
92 add r6, r6, r2 @ y12 = x12 + x4
93 sub r2, r6, r2, asl #1 @ x12 - x4
94 add r7, r7, r3 @ y13 = x13 + x5
95 sub r3, r7, r3, asl #1 @ x13 - x5
96 add r8, r8, r4 @ y10 = x14 + x6
97 sub r10, r8, r4, asl #1 @ x14 - x6
98 add r9, r9, r5 @ y11 = x15 + x7
99 sub r11, r9, r5, asl #1 @ x15 - x7
100
101 stmia r1, {r6, r7, r8, r9}
102
103 sub r2, r2, r3 @ (x12 - x4) - (x13 - x5)
104 add r3, r2, r3, asl #1 @ (x12 - x4) + (x13 - x5)
105
106 smull r8, r5, r2, r12
107 mov r5, r5, asl #1
108 smull r8, r6, r3, r12
109 mov r6, r6, asl #1
110 @ no stmia here, r5, r6, r10, r11 are passed to mdct_butterfly_8
111
112 sub r0, r0, #4*4
113 ldmia r0, {r1, r2, r3, r4}
114 bl mdct_butterfly_8
115 add r0, r0, #8*4
116 ldmia r0, {r1, r2, r3, r4, r5, r6, r10, r11}
117 bl mdct_butterfly_8
118
119 ldr pc, [sp], #4
120
121mdct_butterfly_32:
122 stmdb sp!, {r4, r5, r6, r7, r8, r9, r10, r11, r12, lr}
123
124 add r1, r0, #16*4
125
126 ldmia r0, {r2, r3, r4, r5}
127 ldmia r1, {r6, r7, r8, r9}
128 add r6, r6, r2 @ y16 = x16 + x0
129 rsb r2, r6, r2, asl #1 @ x0 - x16
130 add r7, r7, r3 @ y17 = x17 + x1
131 rsb r3, r7, r3, asl #1 @ x1 - x17
132 add r8, r8, r4 @ y18 = x18 + x2
133 rsb r4, r8, r4, asl #1 @ x2 - x18
134 add r9, r9, r5 @ y19 = x19 + x3
135 rsb r5, r9, r5, asl #1 @ x3 - x19
136
137 stmia r1!, {r6, r7, r8, r9}
138
139 ldr r12, =cPI1_8
140 ldr lr, =cPI3_8
141 smull r10, r6, r2, r12
142 smlal r10, r6, r3, lr
143 rsb r2, r2, #0
144 smull r10, r7, r3, r12
145 smlal r10, r7, r2, lr
146 mov r6, r6, asl #1
147 mov r7, r7, asl #1
148
149 add r4, r4, r5 @ (x3 - x19) + (x2 - x18)
150 rsb r5, r4, r5, asl #1 @ (x3 - x19) - (x2 - x18)
151
152 ldr r11, =cPI2_8
153 smull r10, r8, r4, r11
154 mov r8, r8, asl #1
155 smull r10, r9, r5, r11
156 mov r9, r9, asl #1
157
158 stmia r0!, {r6, r7, r8, r9}
159
160 ldmia r0, {r2, r3, r4, r5}
161 ldmia r1, {r6, r7, r8, r9}
162 add r6, r6, r2 @ y20 = x20 + x4
163 rsb r2, r6, r2, asl #1 @ x4 - x20
164 add r7, r7, r3 @ y21 = x21 + x5
165 rsb r3, r7, r3, asl #1 @ x5 - x21
166 add r8, r8, r4 @ y22 = x22 + x6
167 sub r4, r8, r4, asl #1 @ x22 - x6
168 add r9, r9, r5 @ y23 = x23 + x7
169 rsb r5, r9, r5, asl #1 @ x7 - x23
170
171 stmia r1!, {r6, r7, r8, r9}
172
173 smull r10, r6, r2, lr
174 smlal r10, r6, r3, r12
175 rsb r2, r2, #0
176 smull r10, r7, r3, lr
177 smlal r10, r7, r2, r12
178 mov r6, r6, asl #1
179 mov r7, r7, asl #1
180
181 mov r8, r5
182 mov r9, r4
183 stmia r0!, {r6, r7, r8, r9}
184
185 ldmia r0, {r2, r3, r4, r5}
186 ldmia r1, {r6, r7, r8, r9}
187 add r6, r6, r2 @ y24 = x24 + x8
188 sub r2, r6, r2, asl #1 @ x24 - x8
189 add r7, r7, r3 @ y25 = x25 + x9
190 sub r3, r7, r3, asl #1 @ x25 - x9
191 add r8, r8, r4 @ y26 = x26 + x10
192 sub r4, r8, r4, asl #1 @ x26 - x10
193 add r9, r9, r5 @ y27 = x27 + x11
194 sub r5, r9, r5, asl #1 @ x27 - x11
195
196 stmia r1!, {r6, r7, r8, r9}
197
198 smull r10, r7, r2, r12
199 smlal r10, r7, r3, lr
200 rsb r3, r3, #0
201 smull r10, r6, r3, r12
202 smlal r10, r6, r2, lr
203 mov r6, r6, asl #1
204 mov r7, r7, asl #1
205
206 sub r4, r4, r5 @ (x26 - x10) - (x27 - x11)
207 add r5, r4, r5, asl #1 @ (x26 - x10) + (x27 - x11)
208
209 ldr r11, =cPI2_8
210 smull r10, r8, r4, r11
211 mov r8, r8, asl #1
212 smull r10, r9, r5, r11
213 mov r9, r9, asl #1
214
215 stmia r0!, {r6, r7, r8, r9}
216
217 ldmia r0, {r2, r3, r4, r5}
218 ldmia r1, {r6, r7, r8, r9}
219 add r6, r6, r2 @ y28 = x28 + x12
220 sub r2, r6, r2, asl #1 @ x28 - x12
221 add r7, r7, r3 @ y29 = x29 + x13
222 sub r3, r7, r3, asl #1 @ x29 - x13
223 add r8, r8, r4 @ y30 = x30 + x14
224 sub r4, r8, r4, asl #1 @ x30 - x14
225 add r9, r9, r5 @ y31 = x31 + x15
226 sub r5, r9, r5, asl #1 @ x31 - x15
227
228 stmia r1, {r6, r7, r8, r9}
229
230 smull r10, r7, r2, lr
231 smlal r10, r7, r3, r12
232 rsb r3, r3, #0
233 smull r10, r6, r3, lr
234 smlal r10, r6, r2, r12
235 mov r6, r6, asl #1
236 mov r7, r7, asl #1
237
238 mov r8, r4
239 mov r9, r5
240 stmia r0, {r6, r7, r8, r9}
241
242 sub r0, r0, #12*4
243 str r0, [sp, #-4]!
244 bl mdct_butterfly_16
245
246 ldr r0, [sp], #4
247 add r0, r0, #16*4
248 bl mdct_butterfly_16
249
250 ldmia sp!, {r4, r5, r6, r7, r8, r9, r10, r11, r12, pc}
251
252 @ mdct_butterfly_generic_loop(x1, x2, T0, step, Ttop)
253mdct_butterfly_generic_loop:
254 stmdb sp!, {r4, r5, r6, r7, r8, r9, r10, r11, r12, lr}
255 str r2, [sp, #-4]
256 ldr r4, [sp, #40]
2571:
258 ldmdb r0, {r6, r7, r8, r9}
259 ldmdb r1, {r10, r11, r12, r14}
260
261 add r6, r6, r10
262 sub r10, r6, r10, asl #1
263 add r7, r7, r11
264 rsb r11, r7, r11, asl #1
265 add r8, r8, r12
266 sub r12, r8, r12, asl #1
267 add r9, r9, r14
268 rsb r14, r9, r14, asl #1
269
270 stmdb r0!, {r6, r7, r8, r9}
271
272 ldmia r2, {r6, r7}
273 smull r5, r8, r14, r6
274 smlal r5, r8, r12, r7
275 rsb r14, r14, #0
276 smull r5, r9, r12, r6
277 smlal r5, r9, r14, r7
278
279 mov r8, r8, asl #1
280 mov r9, r9, asl #1
281 stmdb r1!, {r8, r9}
282 add r2, r2, r3, asl #2
283
284 ldmia r2, {r6, r7}
285 smull r5, r8, r11, r6
286 smlal r5, r8, r10, r7
287 rsb r11, r11, #0
288 smull r5, r9, r10, r6
289 smlal r5, r9, r11, r7
290
291 mov r8, r8, asl #1
292 mov r9, r9, asl #1
293 stmdb r1!, {r8, r9}
294 add r2, r2, r3, asl #2
295
296 cmp r2, r4
297 blo 1b
298
299 ldr r4, [sp, #-4]
3001:
301 ldmdb r0, {r6, r7, r8, r9}
302 ldmdb r1, {r10, r11, r12, r14}
303
304 add r6, r6, r10
305 sub r10, r6, r10, asl #1
306 add r7, r7, r11
307 sub r11, r7, r11, asl #1
308 add r8, r8, r12
309 sub r12, r8, r12, asl #1
310 add r9, r9, r14
311 sub r14, r9, r14, asl #1
312
313 stmdb r0!, {r6, r7, r8, r9}
314
315 ldmia r2, {r6, r7}
316 smull r5, r9, r14, r6
317 smlal r5, r9, r12, r7
318 rsb r14, r14, #0
319 smull r5, r8, r12, r6
320 smlal r5, r8, r14, r7
321
322 mov r8, r8, asl #1
323 mov r9, r9, asl #1
324 stmdb r1!, {r8, r9}
325 sub r2, r2, r3, asl #2
326
327 ldmia r2, {r6, r7}
328 smull r5, r9, r11, r6
329 smlal r5, r9, r10, r7
330 rsb r11, r11, #0
331 smull r5, r8, r10, r6
332 smlal r5, r8, r11, r7
333
334 mov r8, r8, asl #1
335 mov r9, r9, asl #1
336 stmdb r1!, {r8, r9}
337 sub r2, r2, r3, asl #2
338
339 cmp r2, r4
340 bhi 1b
341
342 ldr r4, [sp, #40]
3431:
344 ldmdb r0, {r6, r7, r8, r9}
345 ldmdb r1, {r10, r11, r12, r14}
346
347 add r6, r6, r10
348 rsb r10, r6, r10, asl #1
349 add r7, r7, r11
350 rsb r11, r7, r11, asl #1
351 add r8, r8, r12
352 rsb r12, r8, r12, asl #1
353 add r9, r9, r14
354 rsb r14, r9, r14, asl #1
355
356 stmdb r0!, {r6, r7, r8, r9}
357
358 ldmia r2, {r6, r7}
359 smull r5, r8, r12, r6
360 smlal r5, r8, r14, r7
361 rsb r12, r12, #0
362 smull r5, r9, r14, r6
363 smlal r5, r9, r12, r7
364
365 mov r8, r8, asl #1
366 mov r9, r9, asl #1
367 stmdb r1!, {r8, r9}
368 add r2, r2, r3, asl #2
369
370 ldmia r2, {r6, r7}
371 smull r5, r8, r10, r6
372 smlal r5, r8, r11, r7
373 rsb r10, r10, #0
374 smull r5, r9, r11, r6
375 smlal r5, r9, r10, r7
376
377 mov r8, r8, asl #1
378 mov r9, r9, asl #1
379 stmdb r1!, {r8, r9}
380 add r2, r2, r3, asl #2
381
382 cmp r2, r4
383 blo 1b
384
385 ldr r4, [sp, #-4]
3861:
387 ldmdb r0, {r6, r7, r8, r9}
388 ldmdb r1, {r10, r11, r12, r14}
389
390 add r6, r6, r10
391 sub r10, r6, r10, asl #1
392 add r7, r7, r11
393 rsb r11, r7, r11, asl #1
394 add r8, r8, r12
395 sub r12, r8, r12, asl #1
396 add r9, r9, r14
397 rsb r14, r9, r14, asl #1
398
399 stmdb r0!, {r6, r7, r8, r9}
400
401 ldmia r2, {r6, r7}
402 smull r5, r9, r12, r6
403 smlal r5, r9, r14, r7
404 rsb r12, r12, #0
405 smull r5, r8, r14, r6
406 smlal r5, r8, r12, r7
407
408 mov r8, r8, asl #1
409 mov r9, r9, asl #1
410 stmdb r1!, {r8, r9}
411 sub r2, r2, r3, asl #2
412
413 ldmia r2, {r6, r7}
414 smull r5, r9, r10, r6
415 smlal r5, r9, r11, r7
416 rsb r10, r10, #0
417 smull r5, r8, r11, r6
418 smlal r5, r8, r10, r7
419
420 mov r8, r8, asl #1
421 mov r9, r9, asl #1
422 stmdb r1!, {r8, r9}
423 sub r2, r2, r3, asl #2
424
425 cmp r2, r4
426 bhi 1b
427
428 ldmia sp!, {r4, r5, r6, r7, r8, r9, r10, r11, r12, pc}
429