0
|
1 /
|
|
2 / decode_3dnow.s - 3DNow! optimized synth_1to1()
|
|
3 /
|
|
4 / This code based 'decode_3dnow.s' by Syuuhei Kashiyama
|
|
5 / <squash@mb.kcom.ne.jp>,only two types of changes have been made:
|
|
6 /
|
|
7 / - remove PREFETCH instruction for speedup
|
|
8 / - change function name for support 3DNow! automatic detect
|
|
9 / - femms moved to before 'call dct64_3dnow'
|
|
10 /
|
|
11 / You can find Kashiyama's original 3dnow! support patch
|
|
12 / (for mpg123-0.59o) at
|
|
13 / http://user.ecc.u-tokyo.ac.jp/~g810370/linux-simd/ (Japanese).
|
|
14 /
|
|
15 / by KIMURA Takuhiro <kim@hannah.ipc.miyakyo-u.ac.jp> - until 31.Mar.1999
|
|
16 / <kim@comtec.co.jp> - after 1.Apr.1999
|
|
17 /
|
|
18 / porting xmms-0.9.1 by Osamu kayasono <jacobi@jcom.home.ne.jp>
|
|
19 / - rename function name for xmms
|
|
20 / - disable equalizer for mpg123
|
|
21
|
|
22 ///
|
|
23 /// Replacement of synth_1to1() with AMD's 3DNow! SIMD operations support
|
|
24 ///
|
|
25 /// Syuuhei Kashiyama <squash@mb.kcom.ne.jp>
|
|
26 ///
|
|
27 /// The author of this program disclaim whole expressed or implied
|
|
28 /// warranties with regard to this program, and in no event shall the
|
|
29 /// author of this program liable to whatever resulted from the use of
|
|
30 /// this program. Use it at your own risk.
|
|
31 ///
|
|
32
|
|
33 .local buffs.40
|
|
34 .comm buffs.40,4352,32
|
|
35 .data
|
|
36 .align 4
|
|
37 .type bo.42,@object
|
|
38 .size bo.42,4
|
|
39 bo.42:
|
|
40 .long 1
|
|
41 .text
|
|
42 .globl mpg123_synth_1to1_3dnow
|
|
43 .type mpg123_synth_1to1_3dnow,@function
|
|
44 mpg123_synth_1to1_3dnow:
|
|
45 subl $24,%esp
|
|
46 pushl %ebp
|
|
47 pushl %edi
|
|
48 xorl %ebp,%ebp
|
|
49 pushl %esi
|
|
50 pushl %ebx
|
|
51 movl 56(%esp),%esi
|
|
52 movl 52(%esp),%edi
|
|
53 movl 0(%esi),%esi
|
|
54 movl 48(%esp),%ebx
|
|
55 addl %edi,%esi
|
|
56 movl %esi,16(%esp)
|
|
57
|
|
58 femms
|
|
59
|
|
60 /// / disable equalizer by Osamu Kayasono
|
|
61 /// cmpl $0,equalfile
|
|
62 /// je .L25
|
|
63 /// pushl %ebx
|
|
64 /// pushl 48(%esp)
|
|
65 /// call do_equalizer_3dnow
|
|
66 /// addl $8,%esp
|
|
67 ///.L25:
|
|
68 testl %ebx,%ebx
|
|
69 jne .L26
|
|
70 decl bo.42
|
|
71 movl $buffs.40,%ecx
|
|
72 andl $15,bo.42
|
|
73 jmp .L27
|
|
74 .L26:
|
|
75 addl $2,16(%esp)
|
|
76 movl $buffs.40+2176,%ecx
|
|
77 .L27:
|
|
78 movl bo.42,%edx
|
|
79 testb $1,%dl
|
|
80 je .L28
|
|
81 movl %edx,36(%esp)
|
|
82 movl %ecx,%ebx
|
|
83 movl 44(%esp),%esi
|
|
84 movl %edx,%edi
|
|
85 pushl %esi
|
|
86 sall $2,%edi
|
|
87 movl %ebx,%eax
|
|
88 movl %edi,24(%esp)
|
|
89 addl %edi,%eax
|
|
90 pushl %eax
|
|
91 movl %edx,%eax
|
|
92 incl %eax
|
|
93 andl $15,%eax
|
|
94 leal 1088(,%eax,4),%eax
|
|
95 addl %ebx,%eax
|
|
96 pushl %eax
|
|
97 call mpg123_dct64_3dnow
|
|
98 addl $12,%esp
|
|
99 jmp .L29
|
|
100 .L28:
|
|
101 leal 1(%edx),%esi
|
|
102 movl 44(%esp),%edi
|
|
103 movl %esi,36(%esp)
|
|
104 leal 1092(%ecx,%edx,4),%eax
|
|
105 pushl %edi
|
|
106 leal 1088(%ecx),%ebx
|
|
107 pushl %eax
|
|
108 sall $2,%esi
|
|
109 leal (%ecx,%edx,4),%eax
|
|
110 pushl %eax
|
|
111 call mpg123_dct64_3dnow
|
|
112 addl $12,%esp
|
|
113 movl %esi,20(%esp)
|
|
114 .L29:
|
|
115 movl $mpg123_decwin+64,%edx
|
|
116 movl $16,%ecx
|
|
117 subl 20(%esp),%edx
|
|
118 movl 16(%esp),%edi
|
|
119
|
|
120 movq (%edx),%mm0
|
|
121 movq (%ebx),%mm1
|
|
122 .align 32
|
|
123 .L33:
|
|
124 movq 8(%edx),%mm3
|
|
125 pfmul %mm1,%mm0
|
|
126 movq 8(%ebx),%mm4
|
|
127 movq 16(%edx),%mm5
|
|
128 pfmul %mm4,%mm3
|
|
129 movq 16(%ebx),%mm6
|
|
130 pfadd %mm3,%mm0
|
|
131 movq 24(%edx),%mm1
|
|
132 pfmul %mm6,%mm5
|
|
133 movq 24(%ebx),%mm2
|
|
134 pfadd %mm5,%mm0
|
|
135 movq 32(%edx),%mm3
|
|
136 pfmul %mm2,%mm1
|
|
137 movq 32(%ebx),%mm4
|
|
138 pfadd %mm1,%mm0
|
|
139 movq 40(%edx),%mm5
|
|
140 pfmul %mm4,%mm3
|
|
141 movq 40(%ebx),%mm6
|
|
142 pfadd %mm3,%mm0
|
|
143 movq 48(%edx),%mm1
|
|
144 pfmul %mm6,%mm5
|
|
145 movq 48(%ebx),%mm2
|
|
146 pfadd %mm0,%mm5
|
|
147 movq 56(%edx),%mm3
|
|
148 pfmul %mm1,%mm2
|
|
149 movq 56(%ebx),%mm4
|
|
150 pfadd %mm5,%mm2
|
|
151 addl $64,%ebx
|
|
152 subl $-128,%edx
|
|
153 movq (%edx),%mm0
|
|
154 pfmul %mm4,%mm3
|
|
155 movq (%ebx),%mm1
|
|
156 pfadd %mm3,%mm2
|
|
157 movq %mm2,%mm3
|
|
158 psrlq $32,%mm3
|
|
159 pfsub %mm3,%mm2
|
|
160 incl %ebp
|
|
161 pf2id %mm2,%mm2
|
|
162 packssdw %mm2,%mm2
|
|
163 movd %mm2,%eax
|
|
164 movw %ax,0(%edi)
|
|
165 addl $4,%edi
|
|
166 decl %ecx
|
|
167 jnz .L33
|
|
168
|
|
169 movd (%ebx),%mm0
|
|
170 movd (%edx),%mm1
|
|
171 punpckldq 8(%ebx),%mm0
|
|
172 punpckldq 8(%edx),%mm1
|
|
173 movd 16(%ebx),%mm3
|
|
174 movd 16(%edx),%mm4
|
|
175 pfmul %mm1,%mm0
|
|
176 punpckldq 24(%ebx),%mm3
|
|
177 punpckldq 24(%edx),%mm4
|
|
178 movd 32(%ebx),%mm5
|
|
179 movd 32(%edx),%mm6
|
|
180 pfmul %mm4,%mm3
|
|
181 punpckldq 40(%ebx),%mm5
|
|
182 punpckldq 40(%edx),%mm6
|
|
183 pfadd %mm3,%mm0
|
|
184 movd 48(%ebx),%mm1
|
|
185 movd 48(%edx),%mm2
|
|
186 pfmul %mm6,%mm5
|
|
187 punpckldq 56(%ebx),%mm1
|
|
188 punpckldq 56(%edx),%mm2
|
|
189 pfadd %mm5,%mm0
|
|
190 pfmul %mm2,%mm1
|
|
191 pfadd %mm1,%mm0
|
|
192 pfacc %mm1,%mm0
|
|
193 pf2id %mm0,%mm0
|
|
194 packssdw %mm0,%mm0
|
|
195 movd %mm0,%eax
|
|
196 movw %ax,0(%edi)
|
|
197 incl %ebp
|
|
198 movl 36(%esp),%esi
|
|
199 addl $-64,%ebx
|
|
200 movl $15,%ebp
|
|
201 addl $4,%edi
|
|
202 leal -128(%edx,%esi,8),%edx
|
|
203
|
|
204 movl $15,%ecx
|
|
205 movd (%ebx),%mm0
|
|
206 movd -4(%edx),%mm1
|
|
207 punpckldq 4(%ebx),%mm0
|
|
208 punpckldq -8(%edx),%mm1
|
|
209 .align 32
|
|
210 .L46:
|
|
211 movd 8(%ebx),%mm3
|
|
212 movd -12(%edx),%mm4
|
|
213 pfmul %mm1,%mm0
|
|
214 punpckldq 12(%ebx),%mm3
|
|
215 punpckldq -16(%edx),%mm4
|
|
216 movd 16(%ebx),%mm5
|
|
217 movd -20(%edx),%mm6
|
|
218 pfmul %mm4,%mm3
|
|
219 punpckldq 20(%ebx),%mm5
|
|
220 punpckldq -24(%edx),%mm6
|
|
221 pfadd %mm3,%mm0
|
|
222 movd 24(%ebx),%mm1
|
|
223 movd -28(%edx),%mm2
|
|
224 pfmul %mm6,%mm5
|
|
225 punpckldq 28(%ebx),%mm1
|
|
226 punpckldq -32(%edx),%mm2
|
|
227 pfadd %mm5,%mm0
|
|
228 movd 32(%ebx),%mm3
|
|
229 movd -36(%edx),%mm4
|
|
230 pfmul %mm2,%mm1
|
|
231 punpckldq 36(%ebx),%mm3
|
|
232 punpckldq -40(%edx),%mm4
|
|
233 pfadd %mm1,%mm0
|
|
234 movd 40(%ebx),%mm5
|
|
235 movd -44(%edx),%mm6
|
|
236 pfmul %mm4,%mm3
|
|
237 punpckldq 44(%ebx),%mm5
|
|
238 punpckldq -48(%edx),%mm6
|
|
239 pfadd %mm3,%mm0
|
|
240 movd 48(%ebx),%mm1
|
|
241 movd -52(%edx),%mm2
|
|
242 pfmul %mm6,%mm5
|
|
243 punpckldq 52(%ebx),%mm1
|
|
244 punpckldq -56(%edx),%mm2
|
|
245 pfadd %mm0,%mm5
|
|
246 movd 56(%ebx),%mm3
|
|
247 movd -60(%edx),%mm4
|
|
248 pfmul %mm2,%mm1
|
|
249 punpckldq 60(%ebx),%mm3
|
|
250 punpckldq (%edx),%mm4
|
|
251 pfadd %mm1,%mm5
|
|
252 addl $-128,%edx
|
|
253 addl $-64,%ebx
|
|
254 movd (%ebx),%mm0
|
|
255 movd -4(%edx),%mm1
|
|
256 pfmul %mm4,%mm3
|
|
257 punpckldq 4(%ebx),%mm0
|
|
258 punpckldq -8(%edx),%mm1
|
|
259 pfadd %mm5,%mm3
|
|
260 pfacc %mm3,%mm3
|
|
261 incl %ebp
|
|
262 pf2id %mm3,%mm3
|
|
263 movd %mm3,%eax
|
|
264 negl %eax
|
|
265 movd %eax,%mm3
|
|
266 packssdw %mm3,%mm3
|
|
267 movd %mm3,%eax
|
|
268 movw %ax,(%edi)
|
|
269 addl $4,%edi
|
|
270 decl %ecx
|
|
271 jnz .L46
|
|
272
|
|
273 femms
|
|
274 movl 56(%esp),%esi
|
|
275 movl %ebp,%eax
|
|
276 subl $-128,0(%esi)
|
|
277 popl %ebx
|
|
278 popl %esi
|
|
279 popl %edi
|
|
280 popl %ebp
|
|
281 addl $24,%esp
|
|
282 ret
|