1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 by Tomasz Malesinski
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
25 .section ICODE_SECTION_MPA_ARM,"ax",%progbits
27 .global synth_full_odd_sbsample
28 .global synth_full_even_sbsample
36 /*;; r5 = loop counter
38 ;; r8,r9 accumulator2 */
40 synth_full_odd_sbsample:
41 stmdb sp!, {r4-r11, lr}
43 ldr r5, =synth_full_sp
48 /* ;; PROD_O and odd half of SB_SAMPLE*/
52 ldmia r1!, {r10, r11, r12, lr}
60 smlal r6, r7, r12, r10
64 smlal r8, r9, r11, r10
70 ldmia r1!, {r11, r12, sp, lr}
71 smlal r6, r7, r11, r10
73 ldr r10, [r4, #88] /*;;1 cycle stall on arm9, but we free up r11*/
74 smlal r8, r9, r11, r10
78 smlal r6, r7, r12, r10
84 smlal r8, r9, r12, r11
92 /* ;; PROD_A and even half of SB_SAMPLE*/
94 ldmia r2!, {r11, r12, sp, lr}
95 smlal r6, r7, r11, r10
97 ldr r10, [r4, #60] /*;;1 cycle stall on arm9, but we free up r11*/
98 smlal r8, r9, r11, r10
101 smlal r6, r7, r12, r11
103 smlal r6, r7, sp, r10
105 smlal r6, r7, lr, r11
107 smlal r8, r9, r12, r10
109 smlal r8, r9, sp, r11
110 smlal r8, r9, lr, r10
113 ldmia r2!, {r11, r12, sp, lr}
114 smlal r6, r7, r11, r10
116 ldr r10, [r4, #92] /*;;1 cycle stall on arm9, but we free up r11*/
117 smlal r8, r9, r11, r10
121 smlal r6, r7, r12, r10
123 smlal r6, r7, sp, r11
125 smlal r6, r7, lr, r10
127 smlal r8, r9, r12, r11
129 smlal r8, r9, sp, r10
130 smlal r8, r9, lr, r11
133 adc r6, r6, r7, lsl #16
134 str r6, [r0, -r5, lsl #2]
137 adc r8, r8, r9, lsl #16
138 str r8, [r0, r5, lsl #2]
143 ldr r5, =synth_full_sp
147 synth_full_even_sbsample:
148 stmdb sp!, {r4-r11, lr}
150 ldr r5, =synth_full_sp
155 /* ;; PROD_O and odd half of SB_SAMPLE*/
159 ldmia r1!, {r10, r11, r12, lr}
161 smull r6, r7, r10, r7
163 smull r8, r9, r10, r9
165 smlal r6, r7, r11, sp
167 smlal r6, r7, r12, r10
172 smlal r8, r9, r11, r10
174 smlal r8, r9, r12, sp
175 smlal r8, r9, lr, r10
178 ldmia r1!, {r11, r12, sp, lr}
180 smlal r6, r7, r11, r10
182 smlal r8, r9, r11, r10
185 smlal r6, r7, r12, r10
187 smlal r6, r7, sp, r11
189 smlal r6, r7, lr, r10
191 smlal r8, r9, r12, r11
193 smlal r8, r9, sp, r10
194 smlal r8, r9, lr, r11
200 ldmia r2!, {r11, r12, sp, lr}
201 smlal r6, r7, r11, r10
202 ldr r10, [r4, #120] /*;;1 cycle stall on arm9, but we free up r11*/
203 smlal r8, r9, r11, r10
206 smlal r6, r7, r12, r10
208 smlal r6, r7, sp, r11
210 smlal r6, r7, lr, r10
213 smlal r8, r9, r12, r11
215 smlal r8, r9, sp, r10
217 smlal r8, r9, lr, r11
220 ldmia r2!, {r11, r12, sp, lr}
221 smlal r6, r7, r11, r10
222 ldr r10, [r4, #88] /*;;1 cycle stall on arm9, but we free up r11*/
223 smlal r8, r9, r11, r10
227 smlal r6, r7, r12, r10
229 smlal r6, r7, sp, r11
231 smlal r6, r7, lr, r10
233 smlal r8, r9, r12, r11
235 smlal r8, r9, sp, r10
236 smlal r8, r9, lr, r11
239 adc r6, r6, r7, lsl #16
240 str r6, [r0, -r5, lsl #2]
243 adc r8, r8, r9, lsl #16
244 str r8, [r0, r5, lsl #2]
249 ldr r5, =synth_full_sp
253 .global III_aliasreduce
256 stmdb sp!, {r4-r11, lr}
257 add r1, r0, r1, lsl #2
269 smull r10, r11, r7, r8
270 smlal r10, r11, r12, r9
271 movs r10, r10, lsr #28
272 adc r10, r10, r11, lsl #4
275 smull r11, r8, r12, r8
276 smlal r11, r8, r7, r9
277 movs r11, r11, lsr #28
278 adc r11, r11, r8, lsl #4
281 smull r12, r7, lr, r8
282 smlal r12, r7, r6, r9
283 movs r12, r12, lsr #28
284 adc r12, r12, r7, lsl #4
285 stmia r4!, {r10, r12}
288 smull r7, r10, r6, r8
289 smlal r7, r10, lr, r9
291 adc r7, r7, r10, lsl #4
321 stmdb sp!, {r4-r7, lr}
322 add r2, r2, r3, lsl #2
325 ldmia r0!, {r4, r5, r6}
326 ldmia r1!, {r7, r12, lr}
336 ldmia r0!, {r4, r5, r6, r7, r12, lr}
337 stmia r1!, {r4, r5, r6, r7, r12, lr}
338 ldmia r0!, {r4, r5, r6, r7, r12, lr}
339 stmia r1!, {r4, r5, r6, r7, r12, lr}
340 ldmia r0!, {r4, r5, r6, r7, r12, lr}
341 stmia r1!, {r4, r5, r6, r7, r12, lr}
344 .section IBSS_SECTION_MPA_ARM,"aw",%nobits