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