summaryrefslogtreecommitdiff
path: root/apps/codecs/libatrac/atrac3_arm.S
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2010-11-10 07:16:04 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2010-11-10 07:16:04 +0000
commitde0fcc35000819bccbd33715acf7e0a91cc5687b (patch)
tree7f28732629b4981573efbd278c7287f2a32b2814 /apps/codecs/libatrac/atrac3_arm.S
parent92c38a728e93bf36a4dc5313d634d0627a84dc9e (diff)
downloadrockbox-de0fcc35000819bccbd33715acf7e0a91cc5687b.tar.gz
rockbox-de0fcc35000819bccbd33715acf7e0a91cc5687b.zip
Introduce macros to ARM asm atrac3 filterbank for better readability.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28546 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libatrac/atrac3_arm.S')
-rw-r--r--apps/codecs/libatrac/atrac3_arm.S150
1 files changed, 48 insertions, 102 deletions
diff --git a/apps/codecs/libatrac/atrac3_arm.S b/apps/codecs/libatrac/atrac3_arm.S
index 0dacff0b7c..68f8de2c4e 100644
--- a/apps/codecs/libatrac/atrac3_arm.S
+++ b/apps/codecs/libatrac/atrac3_arm.S
@@ -93,6 +93,47 @@ atrac3_iqmf_matrixing:
93 * } 93 * }
94 * Note: r12 is a scratch register and can be used without restorage. 94 * Note: r12 is a scratch register and can be used without restorage.
95 ****************************************************************************/ 95 ****************************************************************************/
96
97/* To be called as first block to call smull for initial filling of the result
98 * registers lr/r9 and r12/r8. */
99#define DEWIN_8_SAMPLES_MUL_ASM \
100 ldmia r2!, {r4, r5}; /* load win[0..1] */ \
101 ldmia r1!, {r6, r7}; /* load in [0..1] */ \
102 smull lr , r9, r4, r6; /* s1 = win[0] * in[0] */ \
103 smull r12, r8, r5, r7; /* s2 = win[1] * in[1] */ \
104 ldmia r2!, {r4, r5}; /* load win[i..i+1] */ \
105 ldmia r1!, {r6, r7}; /* load in [i..i+1] */ \
106 smlal lr , r9, r4, r6; /* s1 = win[i ] * in[i ] */ \
107 smlal r12, r8, r5, r7; /* s2 = win[i+1] * in[i+1] */ \
108 ldmia r2!, {r4, r5}; /* load win[i..i+1] */ \
109 ldmia r1!, {r6, r7}; /* load in [i..i+1] */ \
110 smlal lr , r9, r4, r6; /* s1 = win[i ] * in[i ] */ \
111 smlal r12, r8, r5, r7; /* s2 = win[i+1] * in[i+1] */ \
112 ldmia r2!, {r4, r5}; /* load win[i..i+1] */ \
113 ldmia r1!, {r6, r7}; /* load in [i..i+1] */ \
114 smlal lr , r9, r4, r6; /* s1 = win[i ] * in[i ] */ \
115 smlal r12, r8, r5, r7; /* s2 = win[i+1] * in[i+1] */
116
117/* Called after first block. Will always multiply-add to the result registers
118 * lr/r9 and r12/r8. */
119#define DEWIN_8_SAMPLES_MLA_ASM \
120 ldmia r2!, {r4, r5}; /* load win[i..i+1] */ \
121 ldmia r1!, {r6, r7}; /* load in [i..i+1] */ \
122 smlal lr , r9, r4, r6; /* s1 = win[i ] * in[i ] */ \
123 smlal r12, r8, r5, r7; /* s2 = win[i+1] * in[i+1] */ \
124 ldmia r2!, {r4, r5}; /* load win[i..i+1] */ \
125 ldmia r1!, {r6, r7}; /* load in [i..i+1] */ \
126 smlal lr , r9, r4, r6; /* s1 = win[i ] * in[i ] */ \
127 smlal r12, r8, r5, r7; /* s2 = win[i+1] * in[i+1] */ \
128 ldmia r2!, {r4, r5}; /* load win[i..i+1] */ \
129 ldmia r1!, {r6, r7}; /* load in [i..i+1] */ \
130 smlal lr , r9, r4, r6; /* s1 = win[i ] * in[i ] */ \
131 smlal r12, r8, r5, r7; /* s2 = win[i+1] * in[i+1] */ \
132 ldmia r2!, {r4, r5}; /* load win[i..i+1] */ \
133 ldmia r1!, {r6, r7}; /* load in [i..i+1] */ \
134 smlal lr , r9, r4, r6; /* s1 = win[i ] * in[i ] */ \
135 smlal r12, r8, r5, r7; /* s2 = win[i+1] * in[i+1] */
136
96 .align 2 137 .align 2
97 .global atrac3_iqmf_dewindowing 138 .global atrac3_iqmf_dewindowing
98 .type atrac3_iqmf_dewindowing, %function 139 .type atrac3_iqmf_dewindowing, %function
@@ -105,108 +146,13 @@ atrac3_iqmf_dewindowing:
105 stmfd sp!, {r4-r9, lr} /* save non-scratch registers */ 146 stmfd sp!, {r4-r9, lr} /* save non-scratch registers */
106 147
107.iqmf_dewindow_outer_loop: /* outer loop 0...counter-1 */ 148.iqmf_dewindow_outer_loop: /* outer loop 0...counter-1 */
108 /* 0.. 7 */ 149
109 ldmia r2!, {r4, r5} /* load win[0..1] */ 150 DEWIN_8_SAMPLES_MUL_ASM /* 0.. 7, use "MUL" macro here! */
110 ldmia r1!, {r6, r7} /* load in[0..1] */ 151 DEWIN_8_SAMPLES_MLA_ASM /* 8..15 */
111 smull lr , r9, r4, r6 /* s1 = win[0] * in[0] */ 152 DEWIN_8_SAMPLES_MLA_ASM /* 16..23 */
112 smull r12, r8, r5, r7 /* s2 = win[1] * in[1] */ 153 DEWIN_8_SAMPLES_MLA_ASM /* 24..31 */
113 ldmia r2!, {r4, r5} /* load win[i...i+1] */ 154 DEWIN_8_SAMPLES_MLA_ASM /* 32..39 */
114 ldmia r1!, {r6, r7} /* load in[i...i+1] */ 155 DEWIN_8_SAMPLES_MLA_ASM /* 40..47 */
115 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
116 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
117 ldmia r2!, {r4, r5} /* load win[i...i+1] */
118 ldmia r1!, {r6, r7} /* load in[i...i+1] */
119 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
120 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
121 ldmia r2!, {r4, r5} /* load win[i...i+1] */
122 ldmia r1!, {r6, r7} /* load in[i...i+1] */
123 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
124 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
125 /* 8..15 */
126 ldmia r2!, {r4, r5} /* load win[i...i+1] */
127 ldmia r1!, {r6, r7} /* load in[i...i+1] */
128 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
129 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
130 ldmia r2!, {r4, r5} /* load win[i...i+1] */
131 ldmia r1!, {r6, r7} /* load in[i...i+1] */
132 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
133 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
134 ldmia r2!, {r4, r5} /* load win[i...i+1] */
135 ldmia r1!, {r6, r7} /* load in[i...i+1] */
136 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
137 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
138 ldmia r2!, {r4, r5} /* load win[i...i+1] */
139 ldmia r1!, {r6, r7} /* load in[i...i+1] */
140 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
141 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
142 /* 16..23 */
143 ldmia r2!, {r4, r5} /* load win[i...i+1] */
144 ldmia r1!, {r6, r7} /* load in[i...i+1] */
145 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
146 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
147 ldmia r2!, {r4, r5} /* load win[i...i+1] */
148 ldmia r1!, {r6, r7} /* load in[i...i+1] */
149 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
150 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
151 ldmia r2!, {r4, r5} /* load win[i...i+1] */
152 ldmia r1!, {r6, r7} /* load in[i...i+1] */
153 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
154 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
155 ldmia r2!, {r4, r5} /* load win[i...i+1] */
156 ldmia r1!, {r6, r7} /* load in[i...i+1] */
157 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
158 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
159 /* 24..31 */
160 ldmia r2!, {r4, r5} /* load win[i...i+1] */
161 ldmia r1!, {r6, r7} /* load in[i...i+1] */
162 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
163 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
164 ldmia r2!, {r4, r5} /* load win[i...i+1] */
165 ldmia r1!, {r6, r7} /* load in[i...i+1] */
166 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
167 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
168 ldmia r2!, {r4, r5} /* load win[i...i+1] */
169 ldmia r1!, {r6, r7} /* load in[i...i+1] */
170 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
171 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
172 ldmia r2!, {r4, r5} /* load win[i...i+1] */
173 ldmia r1!, {r6, r7} /* load in[i...i+1] */
174 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
175 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
176 /* 32..39 */
177 ldmia r2!, {r4, r5} /* load win[i...i+1] */
178 ldmia r1!, {r6, r7} /* load in[i...i+1] */
179 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
180 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
181 ldmia r2!, {r4, r5} /* load win[i...i+1] */
182 ldmia r1!, {r6, r7} /* load in[i...i+1] */
183 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
184 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
185 ldmia r2!, {r4, r5} /* load win[i...i+1] */
186 ldmia r1!, {r6, r7} /* load in[i...i+1] */
187 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
188 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
189 ldmia r2!, {r4, r5} /* load win[i...i+1] */
190 ldmia r1!, {r6, r7} /* load in[i...i+1] */
191 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
192 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
193 /* 40..47 */
194 ldmia r2!, {r4, r5} /* load win[i...i+1] */
195 ldmia r1!, {r6, r7} /* load in[i...i+1] */
196 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
197 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
198 ldmia r2!, {r4, r5} /* load win[i...i+1] */
199 ldmia r1!, {r6, r7} /* load in[i...i+1] */
200 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
201 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
202 ldmia r2!, {r4, r5} /* load win[i...i+1] */
203 ldmia r1!, {r6, r7} /* load in[i...i+1] */
204 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
205 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
206 ldmia r2!, {r4, r5} /* load win[i...i+1] */
207 ldmia r1!, {r6, r7} /* load in[i...i+1] */
208 smlal lr , r9, r4, r6 /* s1 = win[i ] * in[i ] */
209 smlal r12, r8, r5, r7 /* s2 = win[i+1] * in[i+1] */
210 156
211 mov lr , lr , lsr #31 157 mov lr , lr , lsr #31
212 orr r9, lr , r9, lsl #1 /* s1 = low>>31 || hi<<1 */ 158 orr r9, lr , r9, lsl #1 /* s1 = low>>31 || hi<<1 */