Mercurial > mplayer.hg
annotate mp3lib/dct64_k7.c @ 6808:e595ea5b471d
documenting cropdetect's parameter
author | arpi |
---|---|
date | Fri, 26 Jul 2002 00:12:13 +0000 |
parents | 82a03c17f314 |
children | 7d20830716a1 |
rev | line source |
---|---|
4148 | 1 /* |
2 * This code was taken from http://www.mpg123.org | |
3 * See ChangeLog of mpg123-0.59s-pre.1 for detail | |
4 * Applied to mplayer by Nick Kurshev <nickols_k@mail.ru> | |
5 * Partial 3dnowex-DSP! optimization by Nick Kurshev | |
6 * | |
7 * TODO: optimize scalar 3dnow! code | |
8 * Warning: Phases 7 & 8 are not tested | |
9 */ | |
10 #define real float /* ugly - but only way */ | |
11 | |
5291 | 12 #include "../mangle.h" |
13 | |
4148 | 14 static unsigned long long int __attribute__((aligned(8))) x_plus_minus_3dnow = 0x8000000000000000ULL; |
15 static float plus_1f = 1.0; | |
16 | |
17 void __attribute__ (( __stdcall__ )) dct64_MMX_3dnowex(real *a,real *b,real *c) | |
18 { | |
19 char tmp[256]; | |
20 __asm __volatile( | |
21 " movl %2,%%eax\n\t" | |
22 | |
23 " leal 128+%3,%%edx\n\t" | |
24 " movl %0,%%esi\n\t" | |
25 " movl %1,%%edi\n\t" | |
5291 | 26 " movl $"MANGLE(costab_mmx)",%%ebx\n\t" |
4148 | 27 " leal %3,%%ecx\n\t" |
28 | |
29 /* Phase 1*/ | |
30 " movq (%%eax), %%mm0\n\t" | |
31 " movq 8(%%eax), %%mm4\n\t" | |
32 " movq %%mm0, %%mm3\n\t" | |
33 " movq %%mm4, %%mm7\n\t" | |
34 " movq 120(%%eax), %%mm1\n\t" | |
35 " movq 112(%%eax), %%mm5\n\t" | |
36 " pswapd %%mm1, %%mm1\n\t" | |
37 " pswapd %%mm5, %%mm5\n\t" | |
38 " pfadd %%mm1, %%mm0\n\t" | |
39 " pfadd %%mm5, %%mm4\n\t" | |
40 " movq %%mm0, (%%edx)\n\t" | |
41 " movq %%mm4, 8(%%edx)\n\t" | |
42 " pfsub %%mm1, %%mm3\n\t" | |
43 " pfsub %%mm5, %%mm7\n\t" | |
44 " pfmul (%%ebx), %%mm3\n\t" | |
45 " pfmul 8(%%ebx), %%mm7\n\t" | |
46 " pswapd %%mm3, %%mm3\n\t" | |
47 " pswapd %%mm7, %%mm7\n\t" | |
48 " movq %%mm3, 120(%%edx)\n\t" | |
49 " movq %%mm7, 112(%%edx)\n\t" | |
50 | |
51 " movq 16(%%eax), %%mm0\n\t" | |
52 " movq 24(%%eax), %%mm4\n\t" | |
53 " movq %%mm0, %%mm3\n\t" | |
54 " movq %%mm4, %%mm7\n\t" | |
55 " movq 104(%%eax), %%mm1\n\t" | |
56 " movq 96(%%eax), %%mm5\n\t" | |
57 " pswapd %%mm1, %%mm1\n\t" | |
58 " pswapd %%mm5, %%mm5\n\t" | |
59 " pfadd %%mm1, %%mm0\n\t" | |
60 " pfadd %%mm5, %%mm4\n\t" | |
61 " movq %%mm0, 16(%%edx)\n\t" | |
62 " movq %%mm4, 24(%%edx)\n\t" | |
63 " pfsub %%mm1, %%mm3\n\t" | |
64 " pfsub %%mm5, %%mm7\n\t" | |
65 " pfmul 16(%%ebx), %%mm3\n\t" | |
66 " pfmul 24(%%ebx), %%mm7\n\t" | |
67 " pswapd %%mm3, %%mm3\n\t" | |
68 " pswapd %%mm7, %%mm7\n\t" | |
69 " movq %%mm3, 104(%%edx)\n\t" | |
70 " movq %%mm7, 96(%%edx)\n\t" | |
71 | |
72 " movq 32(%%eax), %%mm0\n\t" | |
73 " movq 40(%%eax), %%mm4\n\t" | |
74 " movq %%mm0, %%mm3\n\t" | |
75 " movq %%mm4, %%mm7\n\t" | |
76 " movq 88(%%eax), %%mm1\n\t" | |
77 " movq 80(%%eax), %%mm5\n\t" | |
78 " pswapd %%mm1, %%mm1\n\t" | |
79 " pswapd %%mm5, %%mm5\n\t" | |
80 " pfadd %%mm1, %%mm0\n\t" | |
81 " pfadd %%mm5, %%mm4\n\t" | |
82 " movq %%mm0, 32(%%edx)\n\t" | |
83 " movq %%mm4, 40(%%edx)\n\t" | |
84 " pfsub %%mm1, %%mm3\n\t" | |
85 " pfsub %%mm5, %%mm7\n\t" | |
86 " pfmul 32(%%ebx), %%mm3\n\t" | |
87 " pfmul 40(%%ebx), %%mm7\n\t" | |
88 " pswapd %%mm3, %%mm3\n\t" | |
89 " pswapd %%mm7, %%mm7\n\t" | |
90 " movq %%mm3, 88(%%edx)\n\t" | |
91 " movq %%mm7, 80(%%edx)\n\t" | |
92 | |
93 " movq 48(%%eax), %%mm0\n\t" | |
94 " movq 56(%%eax), %%mm4\n\t" | |
95 " movq %%mm0, %%mm3\n\t" | |
96 " movq %%mm4, %%mm7\n\t" | |
97 " movq 72(%%eax), %%mm1\n\t" | |
98 " movq 64(%%eax), %%mm5\n\t" | |
99 " pswapd %%mm1, %%mm1\n\t" | |
100 " pswapd %%mm5, %%mm5\n\t" | |
101 " pfadd %%mm1, %%mm0\n\t" | |
102 " pfadd %%mm5, %%mm4\n\t" | |
103 " movq %%mm0, 48(%%edx)\n\t" | |
104 " movq %%mm4, 56(%%edx)\n\t" | |
105 " pfsub %%mm1, %%mm3\n\t" | |
106 " pfsub %%mm5, %%mm7\n\t" | |
107 " pfmul 48(%%ebx), %%mm3\n\t" | |
108 " pfmul 56(%%ebx), %%mm7\n\t" | |
109 " pswapd %%mm3, %%mm3\n\t" | |
110 " pswapd %%mm7, %%mm7\n\t" | |
111 " movq %%mm3, 72(%%edx)\n\t" | |
112 " movq %%mm7, 64(%%edx)\n\t" | |
113 | |
114 /* Phase 2*/ | |
115 | |
116 " movq (%%edx), %%mm0\n\t" | |
117 " movq 8(%%edx), %%mm4\n\t" | |
118 " movq %%mm0, %%mm3\n\t" | |
119 " movq %%mm4, %%mm7\n\t" | |
120 " movq 56(%%edx), %%mm1\n\t" | |
121 " movq 48(%%edx), %%mm5\n\t" | |
122 " pswapd %%mm1, %%mm1\n\t" | |
123 " pswapd %%mm5, %%mm5\n\t" | |
124 " pfadd %%mm1, %%mm0\n\t" | |
125 " pfadd %%mm5, %%mm4\n\t" | |
126 " movq %%mm0, (%%ecx)\n\t" | |
127 " movq %%mm4, 8(%%ecx)\n\t" | |
128 " pfsub %%mm1, %%mm3\n\t" | |
129 " pfsub %%mm5, %%mm7\n\t" | |
130 " pfmul 64(%%ebx), %%mm3\n\t" | |
131 " pfmul 72(%%ebx), %%mm7\n\t" | |
132 " pswapd %%mm3, %%mm3\n\t" | |
133 " pswapd %%mm7, %%mm7\n\t" | |
134 " movq %%mm3, 56(%%ecx)\n\t" | |
135 " movq %%mm7, 48(%%ecx)\n\t" | |
136 | |
137 " movq 16(%%edx), %%mm0\n\t" | |
138 " movq 24(%%edx), %%mm4\n\t" | |
139 " movq %%mm0, %%mm3\n\t" | |
140 " movq %%mm4, %%mm7\n\t" | |
141 " movq 40(%%edx), %%mm1\n\t" | |
142 " movq 32(%%edx), %%mm5\n\t" | |
143 " pswapd %%mm1, %%mm1\n\t" | |
144 " pswapd %%mm5, %%mm5\n\t" | |
145 " pfadd %%mm1, %%mm0\n\t" | |
146 " pfadd %%mm5, %%mm4\n\t" | |
147 " movq %%mm0, 16(%%ecx)\n\t" | |
148 " movq %%mm4, 24(%%ecx)\n\t" | |
149 " pfsub %%mm1, %%mm3\n\t" | |
150 " pfsub %%mm5, %%mm7\n\t" | |
151 " pfmul 80(%%ebx), %%mm3\n\t" | |
152 " pfmul 88(%%ebx), %%mm7\n\t" | |
153 " pswapd %%mm3, %%mm3\n\t" | |
154 " pswapd %%mm7, %%mm7\n\t" | |
155 " movq %%mm3, 40(%%ecx)\n\t" | |
156 " movq %%mm7, 32(%%ecx)\n\t" | |
157 | |
158 /* Phase 3*/ | |
159 | |
160 " movq 64(%%edx), %%mm0\n\t" | |
161 " movq 72(%%edx), %%mm4\n\t" | |
162 " movq %%mm0, %%mm3\n\t" | |
163 " movq %%mm4, %%mm7\n\t" | |
164 " movq 120(%%edx), %%mm1\n\t" | |
165 " movq 112(%%edx), %%mm5\n\t" | |
166 " pswapd %%mm1, %%mm1\n\t" | |
167 " pswapd %%mm5, %%mm5\n\t" | |
168 " pfadd %%mm1, %%mm0\n\t" | |
169 " pfadd %%mm5, %%mm4\n\t" | |
170 " movq %%mm0, 64(%%ecx)\n\t" | |
171 " movq %%mm4, 72(%%ecx)\n\t" | |
172 " pfsubr %%mm1, %%mm3\n\t" | |
173 " pfsubr %%mm5, %%mm7\n\t" | |
174 " pfmul 64(%%ebx), %%mm3\n\t" | |
175 " pfmul 72(%%ebx), %%mm7\n\t" | |
176 " pswapd %%mm3, %%mm3\n\t" | |
177 " pswapd %%mm7, %%mm7\n\t" | |
178 " movq %%mm3, 120(%%ecx)\n\t" | |
179 " movq %%mm7, 112(%%ecx)\n\t" | |
180 | |
181 " movq 80(%%edx), %%mm0\n\t" | |
182 " movq 88(%%edx), %%mm4\n\t" | |
183 " movq %%mm0, %%mm3\n\t" | |
184 " movq %%mm4, %%mm7\n\t" | |
185 " movq 104(%%edx), %%mm1\n\t" | |
186 " movq 96(%%edx), %%mm5\n\t" | |
187 " pswapd %%mm1, %%mm1\n\t" | |
188 " pswapd %%mm5, %%mm5\n\t" | |
189 " pfadd %%mm1, %%mm0\n\t" | |
190 " pfadd %%mm5, %%mm4\n\t" | |
191 " movq %%mm0, 80(%%ecx)\n\t" | |
192 " movq %%mm4, 88(%%ecx)\n\t" | |
193 " pfsubr %%mm1, %%mm3\n\t" | |
194 " pfsubr %%mm5, %%mm7\n\t" | |
195 " pfmul 80(%%ebx), %%mm3\n\t" | |
196 " pfmul 88(%%ebx), %%mm7\n\t" | |
197 " pswapd %%mm3, %%mm3\n\t" | |
198 " pswapd %%mm7, %%mm7\n\t" | |
199 " movq %%mm3, 104(%%ecx)\n\t" | |
200 " movq %%mm7, 96(%%ecx)\n\t" | |
201 | |
202 /* Phase 4*/ | |
203 | |
204 " movq 96(%%ebx), %%mm2\n\t" | |
205 " movq 104(%%ebx), %%mm6\n\t" | |
206 | |
207 " movq (%%ecx), %%mm0\n\t" | |
208 " movq 8(%%ecx), %%mm4\n\t" | |
209 " movq %%mm0, %%mm3\n\t" | |
210 " movq %%mm4, %%mm7\n\t" | |
211 " movq 24(%%ecx), %%mm1\n\t" | |
212 " movq 16(%%ecx), %%mm5\n\t" | |
213 " pswapd %%mm1, %%mm1\n\t" | |
214 " pswapd %%mm5, %%mm5\n\t" | |
215 " pfadd %%mm1, %%mm0\n\t" | |
216 " pfadd %%mm5, %%mm4\n\t" | |
217 " movq %%mm0, (%%edx)\n\t" | |
218 " movq %%mm4, 8(%%edx)\n\t" | |
219 " pfsub %%mm1, %%mm3\n\t" | |
220 " pfsub %%mm5, %%mm7\n\t" | |
221 " pfmul %%mm2, %%mm3\n\t" | |
222 " pfmul %%mm6, %%mm7\n\t" | |
223 " pswapd %%mm3, %%mm3\n\t" | |
224 " pswapd %%mm7, %%mm7\n\t" | |
225 " movq %%mm3, 24(%%edx)\n\t" | |
226 " movq %%mm7, 16(%%edx)\n\t" | |
227 | |
228 " movq 32(%%ecx), %%mm0\n\t" | |
229 " movq 40(%%ecx), %%mm4\n\t" | |
230 " movq %%mm0, %%mm3\n\t" | |
231 " movq %%mm4, %%mm7\n\t" | |
232 " movq 56(%%ecx), %%mm1\n\t" | |
233 " movq 48(%%ecx), %%mm5\n\t" | |
234 " pswapd %%mm1, %%mm1\n\t" | |
235 " pswapd %%mm5, %%mm5\n\t" | |
236 " pfadd %%mm1, %%mm0\n\t" | |
237 " pfadd %%mm5, %%mm4\n\t" | |
238 " movq %%mm0, 32(%%edx)\n\t" | |
239 " movq %%mm4, 40(%%edx)\n\t" | |
240 " pfsubr %%mm1, %%mm3\n\t" | |
241 " pfsubr %%mm5, %%mm7\n\t" | |
242 " pfmul %%mm2, %%mm3\n\t" | |
243 " pfmul %%mm6, %%mm7\n\t" | |
244 " pswapd %%mm3, %%mm3\n\t" | |
245 " pswapd %%mm7, %%mm7\n\t" | |
246 " movq %%mm3, 56(%%edx)\n\t" | |
247 " movq %%mm7, 48(%%edx)\n\t" | |
248 | |
249 " movq 64(%%ecx), %%mm0\n\t" | |
250 " movq 72(%%ecx), %%mm4\n\t" | |
251 " movq %%mm0, %%mm3\n\t" | |
252 " movq %%mm4, %%mm7\n\t" | |
253 " movq 88(%%ecx), %%mm1\n\t" | |
254 " movq 80(%%ecx), %%mm5\n\t" | |
255 " pswapd %%mm1, %%mm1\n\t" | |
256 " pswapd %%mm5, %%mm5\n\t" | |
257 " pfadd %%mm1, %%mm0\n\t" | |
258 " pfadd %%mm5, %%mm4\n\t" | |
259 " movq %%mm0, 64(%%edx)\n\t" | |
260 " movq %%mm4, 72(%%edx)\n\t" | |
261 " pfsub %%mm1, %%mm3\n\t" | |
262 " pfsub %%mm5, %%mm7\n\t" | |
263 " pfmul %%mm2, %%mm3\n\t" | |
264 " pfmul %%mm6, %%mm7\n\t" | |
265 " pswapd %%mm3, %%mm3\n\t" | |
266 " pswapd %%mm7, %%mm7\n\t" | |
267 " movq %%mm3, 88(%%edx)\n\t" | |
268 " movq %%mm7, 80(%%edx)\n\t" | |
269 | |
270 " movq 96(%%ecx), %%mm0\n\t" | |
271 " movq 104(%%ecx), %%mm4\n\t" | |
272 " movq %%mm0, %%mm3\n\t" | |
273 " movq %%mm4, %%mm7\n\t" | |
274 " movq 120(%%ecx), %%mm1\n\t" | |
275 " movq 112(%%ecx), %%mm5\n\t" | |
276 " pswapd %%mm1, %%mm1\n\t" | |
277 " pswapd %%mm5, %%mm5\n\t" | |
278 " pfadd %%mm1, %%mm0\n\t" | |
279 " pfadd %%mm5, %%mm4\n\t" | |
280 " movq %%mm0, 96(%%edx)\n\t" | |
281 " movq %%mm4, 104(%%edx)\n\t" | |
282 " pfsubr %%mm1, %%mm3\n\t" | |
283 " pfsubr %%mm5, %%mm7\n\t" | |
284 " pfmul %%mm2, %%mm3\n\t" | |
285 " pfmul %%mm6, %%mm7\n\t" | |
286 " pswapd %%mm3, %%mm3\n\t" | |
287 " pswapd %%mm7, %%mm7\n\t" | |
288 " movq %%mm3, 120(%%edx)\n\t" | |
289 " movq %%mm7, 112(%%edx)\n\t" | |
290 | |
291 /* Phase 5 */ | |
292 | |
293 " movq 112(%%ebx), %%mm2\n\t" | |
294 | |
295 " movq (%%edx), %%mm0\n\t" | |
296 " movq 16(%%edx), %%mm4\n\t" | |
297 " movq %%mm0, %%mm3\n\t" | |
298 " movq %%mm4, %%mm7\n\t" | |
299 " movq 8(%%edx), %%mm1\n\t" | |
300 " movq 24(%%edx), %%mm5\n\t" | |
301 " pswapd %%mm1, %%mm1\n\t" | |
302 " pswapd %%mm5, %%mm5\n\t" | |
303 " pfadd %%mm1, %%mm0\n\t" | |
304 " pfadd %%mm5, %%mm4\n\t" | |
305 " movq %%mm0, (%%ecx)\n\t" | |
306 " movq %%mm4, 16(%%ecx)\n\t" | |
307 " pfsub %%mm1, %%mm3\n\t" | |
308 " pfsubr %%mm5, %%mm7\n\t" | |
309 " pfmul %%mm2, %%mm3\n\t" | |
310 " pfmul %%mm2, %%mm7\n\t" | |
311 " pswapd %%mm3, %%mm3\n\t" | |
312 " pswapd %%mm7, %%mm7\n\t" | |
313 " movq %%mm3, 8(%%ecx)\n\t" | |
314 " movq %%mm7, 24(%%ecx)\n\t" | |
315 | |
316 " movq 32(%%edx), %%mm0\n\t" | |
317 " movq 48(%%edx), %%mm4\n\t" | |
318 " movq %%mm0, %%mm3\n\t" | |
319 " movq %%mm4, %%mm7\n\t" | |
320 " movq 40(%%edx), %%mm1\n\t" | |
321 " movq 56(%%edx), %%mm5\n\t" | |
322 " pswapd %%mm1, %%mm1\n\t" | |
323 " pswapd %%mm5, %%mm5\n\t" | |
324 " pfadd %%mm1, %%mm0\n\t" | |
325 " pfadd %%mm5, %%mm4\n\t" | |
326 " movq %%mm0, 32(%%ecx)\n\t" | |
327 " movq %%mm4, 48(%%ecx)\n\t" | |
328 " pfsub %%mm1, %%mm3\n\t" | |
329 " pfsubr %%mm5, %%mm7\n\t" | |
330 " pfmul %%mm2, %%mm3\n\t" | |
331 " pfmul %%mm2, %%mm7\n\t" | |
332 " pswapd %%mm3, %%mm3\n\t" | |
333 " pswapd %%mm7, %%mm7\n\t" | |
334 " movq %%mm3, 40(%%ecx)\n\t" | |
335 " movq %%mm7, 56(%%ecx)\n\t" | |
336 | |
337 " movq 64(%%edx), %%mm0\n\t" | |
338 " movq 80(%%edx), %%mm4\n\t" | |
339 " movq %%mm0, %%mm3\n\t" | |
340 " movq %%mm4, %%mm7\n\t" | |
341 " movq 72(%%edx), %%mm1\n\t" | |
342 " movq 88(%%edx), %%mm5\n\t" | |
343 " pswapd %%mm1, %%mm1\n\t" | |
344 " pswapd %%mm5, %%mm5\n\t" | |
345 " pfadd %%mm1, %%mm0\n\t" | |
346 " pfadd %%mm5, %%mm4\n\t" | |
347 " movq %%mm0, 64(%%ecx)\n\t" | |
348 " movq %%mm4, 80(%%ecx)\n\t" | |
349 " pfsub %%mm1, %%mm3\n\t" | |
350 " pfsubr %%mm5, %%mm7\n\t" | |
351 " pfmul %%mm2, %%mm3\n\t" | |
352 " pfmul %%mm2, %%mm7\n\t" | |
353 " pswapd %%mm3, %%mm3\n\t" | |
354 " pswapd %%mm7, %%mm7\n\t" | |
355 " movq %%mm3, 72(%%ecx)\n\t" | |
356 " movq %%mm7, 88(%%ecx)\n\t" | |
357 | |
358 " movq 96(%%edx), %%mm0\n\t" | |
359 " movq 112(%%edx), %%mm4\n\t" | |
360 " movq %%mm0, %%mm3\n\t" | |
361 " movq %%mm4, %%mm7\n\t" | |
362 " movq 104(%%edx), %%mm1\n\t" | |
363 " movq 120(%%edx), %%mm5\n\t" | |
364 " pswapd %%mm1, %%mm1\n\t" | |
365 " pswapd %%mm5, %%mm5\n\t" | |
366 " pfadd %%mm1, %%mm0\n\t" | |
367 " pfadd %%mm5, %%mm4\n\t" | |
368 " movq %%mm0, 96(%%ecx)\n\t" | |
369 " movq %%mm4, 112(%%ecx)\n\t" | |
370 " pfsub %%mm1, %%mm3\n\t" | |
371 " pfsubr %%mm5, %%mm7\n\t" | |
372 " pfmul %%mm2, %%mm3\n\t" | |
373 " pfmul %%mm2, %%mm7\n\t" | |
374 " pswapd %%mm3, %%mm3\n\t" | |
375 " pswapd %%mm7, %%mm7\n\t" | |
376 " movq %%mm3, 104(%%ecx)\n\t" | |
377 " movq %%mm7, 120(%%ecx)\n\t" | |
378 | |
379 | |
380 /* Phase 6. This is the end of easy road. */ | |
381 /* Code below is coded in scalar mode. Should be optimized */ | |
382 | |
5291 | 383 " movd "MANGLE(plus_1f)", %%mm6\n\t" |
4148 | 384 " punpckldq 120(%%ebx), %%mm6\n\t" /* mm6 = 1.0 | 120(%%ebx)*/ |
385 " movq x_plus_minus_3dnow, %%mm7\n\t" /* mm7 = +1 | -1 */ | |
386 | |
387 " movq 32(%%ecx), %%mm0\n\t" | |
388 " movq 64(%%ecx), %%mm2\n\t" | |
389 " movq %%mm0, %%mm1\n\t" | |
390 " movq %%mm2, %%mm3\n\t" | |
391 " pxor %%mm7, %%mm1\n\t" | |
392 " pxor %%mm7, %%mm3\n\t" | |
393 " pfacc %%mm1, %%mm0\n\t" | |
394 " pfacc %%mm3, %%mm2\n\t" | |
395 " pfmul %%mm6, %%mm0\n\t" | |
396 " pfmul %%mm6, %%mm2\n\t" | |
397 " movq %%mm0, 32(%%edx)\n\t" | |
398 " movq %%mm2, 64(%%edx)\n\t" | |
399 | |
400 " movd 44(%%ecx), %%mm0\n\t" | |
401 " movd 40(%%ecx), %%mm2\n\t" | |
402 " movd 120(%%ebx), %%mm3\n\t" | |
403 " punpckldq 76(%%ecx), %%mm0\n\t" | |
404 " punpckldq 72(%%ecx), %%mm2\n\t" | |
405 " punpckldq %%mm3, %%mm3\n\t" | |
406 " movq %%mm0, %%mm4\n\t" | |
407 " movq %%mm2, %%mm5\n\t" | |
408 " pfsub %%mm2, %%mm0\n\t" | |
409 " pfmul %%mm3, %%mm0\n\t" | |
410 " movq %%mm0, %%mm1\n\t" | |
411 " pfadd %%mm5, %%mm0\n\t" | |
412 " pfadd %%mm4, %%mm0\n\t" | |
413 " movq %%mm0, %%mm2\n\t" | |
414 " punpckldq %%mm1, %%mm0\n\t" | |
415 " punpckhdq %%mm1, %%mm2\n\t" | |
416 " movq %%mm0, 40(%%edx)\n\t" | |
417 " movq %%mm2, 72(%%edx)\n\t" | |
418 | |
419 " movd 48(%%ecx), %%mm3\n\t" | |
420 " movd 60(%%ecx), %%mm2\n\t" | |
421 " pfsub 52(%%ecx), %%mm3\n\t" | |
422 " pfsub 56(%%ecx), %%mm2\n\t" | |
423 " pfmul 120(%%ebx), %%mm3\n\t" | |
424 " pfmul 120(%%ebx), %%mm2\n\t" | |
425 " movq %%mm2, %%mm1\n\t" | |
426 | |
427 " pfadd 56(%%ecx), %%mm1\n\t" | |
428 " pfadd 60(%%ecx), %%mm1\n\t" | |
429 " movq %%mm1, %%mm0\n\t" | |
430 | |
431 " pfadd 48(%%ecx), %%mm0\n\t" | |
432 " pfadd 52(%%ecx), %%mm0\n\t" | |
433 " pfadd %%mm3, %%mm1\n\t" | |
434 " punpckldq %%mm2, %%mm1\n\t" | |
435 " pfadd %%mm3, %%mm2\n\t" | |
436 " punpckldq %%mm2, %%mm0\n\t" | |
437 " movq %%mm1, 56(%%edx)\n\t" | |
438 " movq %%mm0, 48(%%edx)\n\t" | |
439 | |
440 /*---*/ | |
441 | |
442 " movd 92(%%ecx), %%mm1\n\t" | |
443 " pfsub 88(%%ecx), %%mm1\n\t" | |
444 " pfmul 120(%%ebx), %%mm1\n\t" | |
445 " movd %%mm1, 92(%%edx)\n\t" | |
446 " pfadd 92(%%ecx), %%mm1\n\t" | |
447 " pfadd 88(%%ecx), %%mm1\n\t" | |
448 " movq %%mm1, %%mm0\n\t" | |
449 | |
450 " pfadd 80(%%ecx), %%mm0\n\t" | |
451 " pfadd 84(%%ecx), %%mm0\n\t" | |
452 " movd %%mm0, 80(%%edx)\n\t" | |
453 | |
454 " movd 80(%%ecx), %%mm0\n\t" | |
455 " pfsub 84(%%ecx), %%mm0\n\t" | |
456 " pfmul 120(%%ebx), %%mm0\n\t" | |
457 " pfadd %%mm0, %%mm1\n\t" | |
458 " pfadd 92(%%edx), %%mm0\n\t" | |
459 " punpckldq %%mm1, %%mm0\n\t" | |
460 " movq %%mm0, 84(%%edx)\n\t" | |
461 | |
462 " movq 96(%%ecx), %%mm0\n\t" | |
463 " movq %%mm0, %%mm1\n\t" | |
464 " pxor %%mm7, %%mm1\n\t" | |
465 " pfacc %%mm1, %%mm0\n\t" | |
466 " pfmul %%mm6, %%mm0\n\t" | |
467 " movq %%mm0, 96(%%edx)\n\t" | |
468 | |
469 " movd 108(%%ecx), %%mm0\n\t" | |
470 " pfsub 104(%%ecx), %%mm0\n\t" | |
471 " pfmul 120(%%ebx), %%mm0\n\t" | |
472 " movd %%mm0, 108(%%edx)\n\t" | |
473 " pfadd 104(%%ecx), %%mm0\n\t" | |
474 " pfadd 108(%%ecx), %%mm0\n\t" | |
475 " movd %%mm0, 104(%%edx)\n\t" | |
476 | |
477 " movd 124(%%ecx), %%mm1\n\t" | |
478 " pfsub 120(%%ecx), %%mm1\n\t" | |
479 " pfmul 120(%%ebx), %%mm1\n\t" | |
480 " movd %%mm1, 124(%%edx)\n\t" | |
481 " pfadd 120(%%ecx), %%mm1\n\t" | |
482 " pfadd 124(%%ecx), %%mm1\n\t" | |
483 " movq %%mm1, %%mm0\n\t" | |
484 | |
485 " pfadd 112(%%ecx), %%mm0\n\t" | |
486 " pfadd 116(%%ecx), %%mm0\n\t" | |
487 " movd %%mm0, 112(%%edx)\n\t" | |
488 | |
489 " movd 112(%%ecx), %%mm0\n\t" | |
490 " pfsub 116(%%ecx), %%mm0\n\t" | |
491 " pfmul 120(%%ebx), %%mm0\n\t" | |
492 " pfadd %%mm0,%%mm1\n\t" | |
493 " pfadd 124(%%edx), %%mm0\n\t" | |
494 " punpckldq %%mm1, %%mm0\n\t" | |
495 " movq %%mm0, 116(%%edx)\n\t" | |
496 | |
497 " jnz .L01\n\t" | |
498 | |
499 /* Phase 7*/ | |
500 /* Code below is coded in scalar mode. Should be optimized */ | |
501 | |
502 " movd (%%ecx), %%mm0\n\t" | |
503 " pfadd 4(%%ecx), %%mm0\n\t" | |
504 " movd %%mm0, 1024(%%esi)\n\t" | |
505 | |
506 " movd (%%ecx), %%mm0\n\t" | |
507 " pfsub 4(%%ecx), %%mm0\n\t" | |
508 " pfmul 120(%%ebx), %%mm0\n\t" | |
509 " movd %%mm0, (%%esi)\n\t" | |
510 " movd %%mm0, (%%edi)\n\t" | |
511 | |
512 " movd 12(%%ecx), %%mm0\n\t" | |
513 " pfsub 8(%%ecx), %%mm0\n\t" | |
514 " pfmul 120(%%ebx), %%mm0\n\t" | |
515 " movd %%mm0, 512(%%edi)\n\t" | |
516 " pfadd 12(%%ecx), %%mm0\n\t" | |
517 " pfadd 8(%%ecx), %%mm0\n\t" | |
518 " movd %%mm0, 512(%%esi)\n\t" | |
519 | |
520 " movd 16(%%ecx), %%mm0\n\t" | |
521 " pfsub 20(%%ecx), %%mm0\n\t" | |
522 " pfmul 120(%%ebx), %%mm0\n\t" | |
523 " movq %%mm0, %%mm3\n\t" | |
524 | |
525 " movd 28(%%ecx), %%mm0\n\t" | |
526 " pfsub 24(%%ecx), %%mm0\n\t" | |
527 " pfmul 120(%%ebx), %%mm0\n\t" | |
528 " movd %%mm0, 768(%%edi)\n\t" | |
529 " movq %%mm0, %%mm2\n\t" | |
530 | |
531 " pfadd 24(%%ecx), %%mm0\n\t" | |
532 " pfadd 28(%%ecx), %%mm0\n\t" | |
533 " movq %%mm0, %%mm1\n\t" | |
534 | |
535 " pfadd 16(%%ecx), %%mm0\n\t" | |
536 " pfadd 20(%%ecx), %%mm0\n\t" | |
537 " movd %%mm0, 768(%%esi)\n\t" | |
538 " pfadd %%mm3, %%mm1\n\t" | |
539 " movd %%mm1, 256(%%esi)\n\t" | |
540 " pfadd %%mm3, %%mm2\n\t" | |
541 " movd %%mm2, 256(%%edi)\n\t" | |
542 | |
543 /* Phase 8*/ | |
544 | |
545 " movq 32(%%edx), %%mm0\n\t" | |
546 " movq 48(%%edx), %%mm1\n\t" | |
547 " pfadd 48(%%edx), %%mm0\n\t" | |
548 " pfadd 40(%%edx), %%mm1\n\t" | |
549 " movd %%mm0, 896(%%esi)\n\t" | |
550 " movd %%mm1, 640(%%esi)\n\t" | |
551 " psrlq $32, %%mm0\n\t" | |
552 " psrlq $32, %%mm1\n\t" | |
553 " movd %%mm0, 128(%%edi)\n\t" | |
554 " movd %%mm1, 384(%%edi)\n\t" | |
555 | |
556 " movd 40(%%edx), %%mm0\n\t" | |
557 " pfadd 56(%%edx), %%mm0\n\t" | |
558 " movd %%mm0, 384(%%esi)\n\t" | |
559 | |
560 " movd 56(%%edx), %%mm0\n\t" | |
561 " pfadd 36(%%edx), %%mm0\n\t" | |
562 " movd %%mm0, 128(%%esi)\n\t" | |
563 | |
564 " movd 60(%%edx), %%mm0\n\t" | |
565 " movd %%mm0, 896(%%edi)\n\t" | |
566 " pfadd 44(%%edx), %%mm0\n\t" | |
567 " movd %%mm0, 640(%%edi)\n\t" | |
568 | |
569 " movq 96(%%edx), %%mm0\n\t" | |
570 " movq 112(%%edx), %%mm2\n\t" | |
571 " movq 104(%%edx), %%mm4\n\t" | |
572 " pfadd 112(%%edx), %%mm0\n\t" | |
573 " pfadd 104(%%edx), %%mm2\n\t" | |
574 " pfadd 120(%%edx), %%mm4\n\t" | |
575 " movq %%mm0, %%mm1\n\t" | |
576 " movq %%mm2, %%mm3\n\t" | |
577 " movq %%mm4, %%mm5\n\t" | |
578 " pfadd 64(%%edx), %%mm0\n\t" | |
579 " pfadd 80(%%edx), %%mm2\n\t" | |
580 " pfadd 72(%%edx), %%mm4\n\t" | |
581 " movd %%mm0, 960(%%esi)\n\t" | |
582 " movd %%mm2, 704(%%esi)\n\t" | |
583 " movd %%mm4, 448(%%esi)\n\t" | |
584 " psrlq $32, %%mm0\n\t" | |
585 " psrlq $32, %%mm2\n\t" | |
586 " psrlq $32, %%mm4\n\t" | |
587 " movd %%mm0, 64(%%edi)\n\t" | |
588 " movd %%mm2, 320(%%edi)\n\t" | |
589 " movd %%mm4, 576(%%edi)\n\t" | |
590 " pfadd 80(%%edx), %%mm1\n\t" | |
591 " pfadd 72(%%edx), %%mm3\n\t" | |
592 " pfadd 88(%%edx), %%mm5\n\t" | |
593 " movd %%mm1, 832(%%esi)\n\t" | |
594 " movd %%mm3, 576(%%esi)\n\t" | |
595 " movd %%mm5, 320(%%esi)\n\t" | |
596 " psrlq $32, %%mm1\n\t" | |
597 " psrlq $32, %%mm3\n\t" | |
598 " psrlq $32, %%mm5\n\t" | |
599 " movd %%mm1, 192(%%edi)\n\t" | |
600 " movd %%mm3, 448(%%edi)\n\t" | |
601 " movd %%mm5, 704(%%edi)\n\t" | |
602 | |
603 " movd 120(%%edx), %%mm0\n\t" | |
604 " pfadd 100(%%edx), %%mm0\n\t" | |
605 " movq %%mm0, %%mm1\n\t" | |
606 " pfadd 88(%%edx), %%mm0\n\t" | |
607 " movd %%mm0, 192(%%esi)\n\t" | |
608 " pfadd 68(%%edx), %%mm1\n\t" | |
609 " movd %%mm1, 64(%%esi)\n\t" | |
610 | |
611 " movd 124(%%edx), %%mm0\n\t" | |
612 " movd %%mm0, 960(%%edi)\n\t" | |
613 " pfadd 92(%%edx), %%mm0\n\t" | |
614 " movd %%mm0, 832(%%edi)\n\t" | |
615 | |
616 " jmp .L_bye\n\t" | |
617 ".L01: \n\t" | |
618 /* Phase 9*/ | |
619 | |
620 " movq (%%ecx), %%mm0\n\t" | |
621 " movq %%mm0, %%mm1\n\t" | |
622 " pxor %%mm7, %%mm1\n\t" | |
623 " pfacc %%mm1, %%mm0\n\t" | |
624 " pfmul %%mm6, %%mm0\n\t" | |
625 " pf2id %%mm0, %%mm0\n\t" | |
626 " movd %%mm0, %%eax\n\t" | |
627 " movw %%ax, 512(%%esi)\n\t" | |
628 " psrlq $32, %%mm0\n\t" | |
629 " movd %%mm0, %%eax\n\t" | |
630 " movw %%ax, (%%esi)\n\t" | |
631 | |
632 " movd 12(%%ecx), %%mm0\n\t" | |
633 " pfsub 8(%%ecx), %%mm0\n\t" | |
634 " pfmul 120(%%ebx), %%mm0\n\t" | |
635 " pf2id %%mm0, %%mm7\n\t" | |
636 " movd %%mm7, %%eax\n\t" | |
637 " movw %%ax, 256(%%edi)\n\t" | |
638 " pfadd 12(%%ecx), %%mm0\n\t" | |
639 " pfadd 8(%%ecx), %%mm0\n\t" | |
640 " pf2id %%mm0, %%mm0\n\t" | |
641 " movd %%mm0, %%eax\n\t" | |
642 " movw %%ax, 256(%%esi)\n\t" | |
643 | |
644 " movd 16(%%ecx), %%mm3\n\t" | |
645 " pfsub 20(%%ecx), %%mm3\n\t" | |
646 " pfmul 120(%%ebx), %%mm3\n\t" | |
647 " movq %%mm3, %%mm2\n\t" | |
648 | |
649 " movd 28(%%ecx), %%mm2\n\t" | |
650 " pfsub 24(%%ecx), %%mm2\n\t" | |
651 " pfmul 120(%%ebx), %%mm2\n\t" | |
652 " movq %%mm2, %%mm1\n\t" | |
653 | |
654 " pf2id %%mm2, %%mm7\n\t" | |
655 " movd %%mm7, %%eax\n\t" | |
656 " movw %%ax, 384(%%edi)\n\t" | |
657 | |
658 " pfadd 24(%%ecx), %%mm1\n\t" | |
659 " pfadd 28(%%ecx), %%mm1\n\t" | |
660 " movq %%mm1, %%mm0\n\t" | |
661 | |
662 " pfadd 16(%%ecx), %%mm0\n\t" | |
663 " pfadd 20(%%ecx), %%mm0\n\t" | |
664 " pf2id %%mm0, %%mm0\n\t" | |
665 " movd %%mm0, %%eax\n\t" | |
666 " movw %%ax, 384(%%esi)\n\t" | |
667 " pfadd %%mm3, %%mm1\n\t" | |
668 " pf2id %%mm1, %%mm1\n\t" | |
669 " movd %%mm1, %%eax\n\t" | |
670 " movw %%ax, 128(%%esi)\n\t" | |
671 " pfadd %%mm3, %%mm2\n\t" | |
672 " pf2id %%mm2, %%mm2\n\t" | |
673 " movd %%mm2, %%eax\n\t" | |
674 " movw %%ax, 128(%%edi)\n\t" | |
675 | |
676 /* Phase 10*/ | |
677 | |
678 " movq 32(%%edx), %%mm0\n\t" | |
679 " movq 48(%%edx), %%mm1\n\t" | |
680 " pfadd 48(%%edx), %%mm0\n\t" | |
681 " pfadd 40(%%edx), %%mm1\n\t" | |
682 " pf2id %%mm0, %%mm0\n\t" | |
683 " pf2id %%mm1, %%mm1\n\t" | |
684 " movd %%mm0, %%eax\n\t" | |
685 " movd %%mm1, %%ecx\n\t" | |
686 " movw %%ax, 448(%%esi)\n\t" | |
687 " movw %%cx, 320(%%esi)\n\t" | |
688 " psrlq $32, %%mm0\n\t" | |
689 " psrlq $32, %%mm1\n\t" | |
690 " movd %%mm0, %%eax\n\t" | |
691 " movd %%mm1, %%ecx\n\t" | |
692 " movw %%ax, 64(%%edi)\n\t" | |
693 " movw %%cx, 192(%%edi)\n\t" | |
694 | |
695 " movd 40(%%edx), %%mm3\n\t" | |
696 " movd 56(%%edx), %%mm4\n\t" | |
697 " movd 60(%%edx), %%mm0\n\t" | |
698 " movd 44(%%edx), %%mm2\n\t" | |
699 " movd 120(%%edx), %%mm5\n\t" | |
700 " punpckldq %%mm4, %%mm3\n\t" | |
701 " punpckldq 124(%%edx), %%mm0\n\t" | |
702 " pfadd 100(%%edx), %%mm5\n\t" | |
703 " punpckldq 36(%%edx), %%mm4\n\t" | |
704 " punpckldq 92(%%edx), %%mm2\n\t" | |
705 " movq %%mm5, %%mm6\n\t" | |
706 " pfadd %%mm4, %%mm3\n\t" | |
707 " pf2id %%mm0, %%mm1\n\t" | |
708 " pf2id %%mm3, %%mm3\n\t" | |
709 " pfadd 88(%%edx), %%mm5\n\t" | |
710 " movd %%mm1, %%eax\n\t" | |
711 " movd %%mm3, %%ecx\n\t" | |
712 " movw %%ax, 448(%%edi)\n\t" | |
713 " movw %%cx, 192(%%esi)\n\t" | |
714 " pf2id %%mm5, %%mm5\n\t" | |
715 " psrlq $32, %%mm1\n\t" | |
716 " psrlq $32, %%mm3\n\t" | |
717 " movd %%mm5, %%ebx\n\t" | |
718 " movd %%mm1, %%eax\n\t" | |
719 " movd %%mm3, %%ecx\n\t" | |
720 " movw %%bx, 96(%%esi)\n\t" | |
721 " movw %%ax, 480(%%edi)\n\t" | |
722 " movw %%cx, 64(%%esi)\n\t" | |
723 " pfadd %%mm2, %%mm0\n\t" | |
724 " pf2id %%mm0, %%mm0\n\t" | |
725 " movd %%mm0, %%eax\n\t" | |
726 " pfadd 68(%%edx), %%mm6\n\t" | |
727 " movw %%ax, 320(%%edi)\n\t" | |
728 " psrlq $32, %%mm0\n\t" | |
729 " pf2id %%mm6, %%mm6\n\t" | |
730 " movd %%mm0, %%eax\n\t" | |
731 " movd %%mm6, %%ebx\n\t" | |
732 " movw %%ax, 416(%%edi)\n\t" | |
733 " movw %%bx, 32(%%esi)\n\t" | |
734 | |
735 " movq 96(%%edx), %%mm0\n\t" | |
736 " movq 112(%%edx), %%mm2\n\t" | |
737 " movq 104(%%edx), %%mm4\n\t" | |
738 " pfadd %%mm2, %%mm0\n\t" | |
739 " pfadd %%mm4, %%mm2\n\t" | |
740 " pfadd 120(%%edx), %%mm4\n\t" | |
741 " movq %%mm0, %%mm1\n\t" | |
742 " movq %%mm2, %%mm3\n\t" | |
743 " movq %%mm4, %%mm5\n\t" | |
744 " pfadd 64(%%edx), %%mm0\n\t" | |
745 " pfadd 80(%%edx), %%mm2\n\t" | |
746 " pfadd 72(%%edx), %%mm4\n\t" | |
747 " pf2id %%mm0, %%mm0\n\t" | |
748 " pf2id %%mm2, %%mm2\n\t" | |
749 " pf2id %%mm4, %%mm4\n\t" | |
750 " movd %%mm0, %%eax\n\t" | |
751 " movd %%mm2, %%ecx\n\t" | |
752 " movd %%mm4, %%ebx\n\t" | |
753 " movw %%ax, 480(%%esi)\n\t" | |
754 " movw %%cx, 352(%%esi)\n\t" | |
755 " movw %%bx, 224(%%esi)\n\t" | |
756 " psrlq $32, %%mm0\n\t" | |
757 " psrlq $32, %%mm2\n\t" | |
758 " psrlq $32, %%mm4\n\t" | |
759 " movd %%mm0, %%eax\n\t" | |
760 " movd %%mm2, %%ecx\n\t" | |
761 " movd %%mm4, %%ebx\n\t" | |
762 " movw %%ax, 32(%%edi)\n\t" | |
763 " movw %%cx, 160(%%edi)\n\t" | |
764 " movw %%bx, 288(%%edi)\n\t" | |
765 " pfadd 80(%%edx), %%mm1\n\t" | |
766 " pfadd 72(%%edx), %%mm3\n\t" | |
767 " pfadd 88(%%edx), %%mm5\n\t" | |
768 " pf2id %%mm1, %%mm1\n\t" | |
769 " pf2id %%mm3, %%mm3\n\t" | |
770 " pf2id %%mm5, %%mm5\n\t" | |
771 " movd %%mm1, %%eax\n\t" | |
772 " movd %%mm3, %%ecx\n\t" | |
773 " movd %%mm5, %%ebx\n\t" | |
774 " movw %%ax, 416(%%esi)\n\t" | |
775 " movw %%cx, 288(%%esi)\n\t" | |
776 " movw %%bx, 160(%%esi)\n\t" | |
777 " psrlq $32, %%mm1\n\t" | |
778 " psrlq $32, %%mm3\n\t" | |
779 " psrlq $32, %%mm5\n\t" | |
780 " movd %%mm1, %%eax\n\t" | |
781 " movd %%mm3, %%ecx\n\t" | |
782 " movd %%mm5, %%ebx\n\t" | |
783 " movw %%ax, 96(%%edi)\n\t" | |
784 " movw %%cx, 224(%%edi)\n\t" | |
785 " movw %%bx, 352(%%edi)\n\t" | |
786 | |
787 " movsw\n\t" | |
788 | |
789 ".L_bye:\n\t" | |
790 " femms\n\t" | |
791 : | |
792 :"m"(a),"m"(b),"m"(c),"m"(tmp[0]) | |
793 :"memory","%ebx","%esi","%edi"); | |
5842
d6eab895c742
Avoid stdcall on cygwin, it causes undefined ref, code needs testing as I have no athlon or k6-2.
atmos4
parents:
5291
diff
changeset
|
794 } |