aboutsummaryrefslogtreecommitdiffhomepage
path: root/mp3lib/dct36_3dnow.c
blob: 7f39caaceaeade1291e94584eb58816aae5db0f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
/*
 * dct36_3dnow.c - 3DNow! optimized dct36()
 *
 * This code based 'dct36_3dnow.s' by Syuuhei Kashiyama
 * <squash@mb.kcom.ne.jp>, only two types of changes have been made:
 *
 * - removed PREFETCH instruction for speedup
 * - changed function name for support 3DNow! automatic detection
 *
 * You can find Kashiyama's original 3dnow! support patch
 * (for mpg123-0.59o) at
 * http://user.ecc.u-tokyo.ac.jp/~g810370/linux-simd/ (Japanese).
 *
 * by KIMURA Takuhiro <kim@hannah.ipc.miyakyo-u.ac.jp> - until 31.Mar.1999
 *                    <kim@comtec.co.jp>               - after  1.Apr.1999
 *
 * Modified for use with MPlayer, for details see the changelog at
 * http://svn.mplayerhq.hu/mplayer/trunk/
 * $Id$
 *
 * Original disclaimer:
 *  The author of this program disclaim whole expressed or implied
 *  warranties with regard to this program, and in no event shall the
 *  author of this program liable to whatever resulted from the use of
 *  this program. Use it at your own risk.
 *
 * 2003/06/21: Moved to GCC inline assembly - Alex Beregszaszi
 */

#define real float /* ugly - but only way */

#include "config.h"
#include "mangle.h"

#ifdef DCT36_OPTIMIZE_FOR_K7
void dct36_3dnowex(real *inbuf, real *o1,
    real *o2, real *wintab, real *tsbuf)
#else
void dct36_3dnow(real *inbuf, real *o1,
    real *o2, real *wintab, real *tsbuf)
#endif
{
    __asm__ volatile(
	"movq (%%eax),%%mm0\n\t"
	"movq 4(%%eax),%%mm1\n\t"
	"pfadd %%mm1,%%mm0\n\t"
	"movq %%mm0,4(%%eax)\n\t"
	"psrlq $32,%%mm1\n\t"
	"movq 12(%%eax),%%mm2\n\t"
	"punpckldq %%mm2,%%mm1\n\t"
	"pfadd %%mm2,%%mm1\n\t"
	"movq %%mm1,12(%%eax)\n\t"
	"psrlq $32,%%mm2\n\t"
	"movq 20(%%eax),%%mm3\n\t"
	"punpckldq %%mm3,%%mm2\n\t"
	"pfadd %%mm3,%%mm2\n\t"
	"movq %%mm2,20(%%eax)\n\t"
	"psrlq $32,%%mm3\n\t"
	"movq 28(%%eax),%%mm4\n\t"
	"punpckldq %%mm4,%%mm3\n\t"
	"pfadd %%mm4,%%mm3\n\t"
	"movq %%mm3,28(%%eax)\n\t"
	"psrlq $32,%%mm4\n\t"
	"movq 36(%%eax),%%mm5\n\t"
	"punpckldq %%mm5,%%mm4\n\t"
	"pfadd %%mm5,%%mm4\n\t"
	"movq %%mm4,36(%%eax)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movq 44(%%eax),%%mm6\n\t"
	"punpckldq %%mm6,%%mm5\n\t"
	"pfadd %%mm6,%%mm5\n\t"
	"movq %%mm5,44(%%eax)\n\t"
	"psrlq $32,%%mm6\n\t"
	"movq 52(%%eax),%%mm7\n\t"
	"punpckldq %%mm7,%%mm6\n\t"
	"pfadd %%mm7,%%mm6\n\t"
	"movq %%mm6,52(%%eax)\n\t"
	"psrlq $32,%%mm7\n\t"
	"movq 60(%%eax),%%mm0\n\t"
	"punpckldq %%mm0,%%mm7\n\t"
	"pfadd %%mm0,%%mm7\n\t"
	"movq %%mm7,60(%%eax)\n\t"
	"psrlq $32,%%mm0\n\t"
	"movd 68(%%eax),%%mm1\n\t"
	"pfadd %%mm1,%%mm0\n\t"
	"movd %%mm0,68(%%eax)\n\t"
	"movd 4(%%eax),%%mm0\n\t"
	"movd 12(%%eax),%%mm1\n\t"
	"punpckldq %%mm1,%%mm0\n\t"
	"punpckldq 20(%%eax),%%mm1\n\t"
	"pfadd %%mm1,%%mm0\n\t"
	"movd %%mm0,12(%%eax)\n\t"
	"psrlq $32,%%mm0\n\t"
	"movd %%mm0,20(%%eax)\n\t"
	"psrlq $32,%%mm1\n\t"
	"movd 28(%%eax),%%mm2\n\t"
	"punpckldq %%mm2,%%mm1\n\t"
	"punpckldq 36(%%eax),%%mm2\n\t"
	"pfadd %%mm2,%%mm1\n\t"
	"movd %%mm1,28(%%eax)\n\t"
	"psrlq $32,%%mm1\n\t"
	"movd %%mm1,36(%%eax)\n\t"
	"psrlq $32,%%mm2\n\t"
	"movd 44(%%eax),%%mm3\n\t"
	"punpckldq %%mm3,%%mm2\n\t"
	"punpckldq 52(%%eax),%%mm3\n\t"
	"pfadd %%mm3,%%mm2\n\t"
	"movd %%mm2,44(%%eax)\n\t"
	"psrlq $32,%%mm2\n\t"
	"movd %%mm2,52(%%eax)\n\t"
	"psrlq $32,%%mm3\n\t"
	"movd 60(%%eax),%%mm4\n\t"
	"punpckldq %%mm4,%%mm3\n\t"
	"punpckldq 68(%%eax),%%mm4\n\t"
	"pfadd %%mm4,%%mm3\n\t"
	"movd %%mm3,60(%%eax)\n\t"
	"psrlq $32,%%mm3\n\t"
	"movd %%mm3,68(%%eax)\n\t"

	"movq 24(%%eax),%%mm0\n\t"
	"movq 48(%%eax),%%mm1\n\t"
	"movd "MANGLE(COS9)"+12,%%mm2\n\t"
	"punpckldq %%mm2,%%mm2\n\t"
	"movd "MANGLE(COS9)"+24,%%mm3\n\t"
	"punpckldq %%mm3,%%mm3\n\t"
	"pfmul %%mm2,%%mm0\n\t"
	"pfmul %%mm3,%%mm1\n\t"
	"pushl %%eax\n\t"
	"movl $1,%%eax\n\t"
	"movd %%eax,%%mm7\n\t"
	"pi2fd %%mm7,%%mm7\n\t"
	"popl %%eax\n\t"
	"movq 8(%%eax),%%mm2\n\t"
	"movd "MANGLE(COS9)"+4,%%mm3\n\t"
	"punpckldq %%mm3,%%mm3\n\t"
	"pfmul %%mm3,%%mm2\n\t"
	"pfadd %%mm0,%%mm2\n\t"
	"movq 40(%%eax),%%mm3\n\t"
	"movd "MANGLE(COS9)"+20,%%mm4\n\t"
	"punpckldq %%mm4,%%mm4\n\t"
	"pfmul %%mm4,%%mm3\n\t"
	"pfadd %%mm3,%%mm2\n\t"
	"movq 56(%%eax),%%mm3\n\t"
	"movd "MANGLE(COS9)"+28,%%mm4\n\t"
	"punpckldq %%mm4,%%mm4\n\t"
	"pfmul %%mm4,%%mm3\n\t"
	"pfadd %%mm3,%%mm2\n\t"
	"movq (%%eax),%%mm3\n\t"
	"movq 16(%%eax),%%mm4\n\t"
	"movd "MANGLE(COS9)"+8,%%mm5\n\t"
	"punpckldq %%mm5,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"pfadd %%mm4,%%mm3\n\t"
	"movq 32(%%eax),%%mm4\n\t"
	"movd "MANGLE(COS9)"+16,%%mm5\n\t"
	"punpckldq %%mm5,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"pfadd %%mm4,%%mm3\n\t"
	"pfadd %%mm1,%%mm3\n\t"
	"movq 64(%%eax),%%mm4\n\t"
	"movd "MANGLE(COS9)"+32,%%mm5\n\t"
	"punpckldq %%mm5,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"pfadd %%mm4,%%mm3\n\t"
	"movq %%mm2,%%mm4\n\t"
	"pfadd %%mm3,%%mm4\n\t"
	"movq %%mm7,%%mm5\n\t"
	"punpckldq "MANGLE(tfcos36)"+0,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"movq %%mm4,%%mm5\n\t"
	"pfacc %%mm5,%%mm5\n\t"
	"movd 108(%%edx),%%mm6\n\t"
	"punpckldq 104(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
#ifdef DCT36_OPTIMIZE_FOR_K7
	"pswapd %%mm5,%%mm5\n\t"
	"movq %%mm5,32(%%ecx)\n\t"
#else
	"movd %%mm5,36(%%ecx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,32(%%ecx)\n\t"
#endif
	"movq %%mm4,%%mm6\n\t"
	"punpckldq %%mm6,%%mm5\n\t"
	"pfsub %%mm6,%%mm5\n\t"
	"punpckhdq %%mm5,%%mm5\n\t"
	"movd 32(%%edx),%%mm6\n\t"
	"punpckldq 36(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd 32(%%esi),%%mm6\n\t"
	"punpckldq 36(%%esi),%%mm6\n\t"
	"pfadd %%mm6,%%mm5\n\t"
	"movd %%mm5,1024(%%ebx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,1152(%%ebx)\n\t"
	"movq %%mm3,%%mm4\n\t"
	"pfsub %%mm2,%%mm4\n\t"
	"movq %%mm7,%%mm5\n\t"
	"punpckldq "MANGLE(tfcos36)"+32,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"movq %%mm4,%%mm5\n\t"
	"pfacc %%mm5,%%mm5\n\t"
	"movd 140(%%edx),%%mm6\n\t"
	"punpckldq 72(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd %%mm5,68(%%ecx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,0(%%ecx)\n\t"
	"movq %%mm4,%%mm6\n\t"
	"punpckldq %%mm6,%%mm5\n\t"
	"pfsub %%mm6,%%mm5\n\t"
	"punpckhdq %%mm5,%%mm5\n\t"
	"movd 0(%%edx),%%mm6\n\t"
	"punpckldq 68(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd 0(%%esi),%%mm6\n\t"
	"punpckldq 68(%%esi),%%mm6\n\t"
	"pfadd %%mm6,%%mm5\n\t"
	"movd %%mm5,0(%%ebx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,2176(%%ebx)\n\t"
	"movq 8(%%eax),%%mm2\n\t"
	"movq 40(%%eax),%%mm3\n\t"
	"pfsub %%mm3,%%mm2\n\t"
	"movq 56(%%eax),%%mm3\n\t"
	"pfsub %%mm3,%%mm2\n\t"
	"movd "MANGLE(COS9)"+12,%%mm3\n\t"
	"punpckldq %%mm3,%%mm3\n\t"
	"pfmul %%mm3,%%mm2\n\t"
	"movq 16(%%eax),%%mm3\n\t"
	"movq 32(%%eax),%%mm4\n\t"
	"pfsub %%mm4,%%mm3\n\t"
	"movq 64(%%eax),%%mm4\n\t"
	"pfsub %%mm4,%%mm3\n\t"
	"movd "MANGLE(COS9)"+24,%%mm4\n\t"
	"punpckldq %%mm4,%%mm4\n\t"
	"pfmul %%mm4,%%mm3\n\t"
	"movq 48(%%eax),%%mm4\n\t"
	"pfsub %%mm4,%%mm3\n\t"
	"movq (%%eax),%%mm4\n\t"
	"pfadd %%mm4,%%mm3\n\t"
	"movq %%mm2,%%mm4\n\t"
	"pfadd %%mm3,%%mm4\n\t"
	"movq %%mm7,%%mm5\n\t"
	"punpckldq "MANGLE(tfcos36)"+4,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"movq %%mm4,%%mm5\n\t"
	"pfacc %%mm5,%%mm5\n\t"
	"movd 112(%%edx),%%mm6\n\t"
	"punpckldq 100(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd %%mm5,40(%%ecx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,28(%%ecx)\n\t"
	"movq %%mm4,%%mm6\n\t"
	"punpckldq %%mm6,%%mm5\n\t"
	"pfsub %%mm6,%%mm5\n\t"
	"punpckhdq %%mm5,%%mm5\n\t"
	"movd 28(%%edx),%%mm6\n\t"
	"punpckldq 40(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd 28(%%esi),%%mm6\n\t"
	"punpckldq 40(%%esi),%%mm6\n\t"
	"pfadd %%mm6,%%mm5\n\t"
	"movd %%mm5,896(%%ebx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,1280(%%ebx)\n\t"
	"movq %%mm3,%%mm4\n\t"
	"pfsub %%mm2,%%mm4\n\t"
	"movq %%mm7,%%mm5\n\t"
	"punpckldq "MANGLE(tfcos36)"+28,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"movq %%mm4,%%mm5\n\t"
	"pfacc %%mm5,%%mm5\n\t"
	"movd 136(%%edx),%%mm6\n\t"
	"punpckldq 76(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd %%mm5,64(%%ecx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,4(%%ecx)\n\t"
	"movq %%mm4,%%mm6\n\t"
	"punpckldq %%mm6,%%mm5\n\t"
	"pfsub %%mm6,%%mm5\n\t"
	"punpckhdq %%mm5,%%mm5\n\t"
	"movd 4(%%edx),%%mm6\n\t"
	"punpckldq 64(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd 4(%%esi),%%mm6\n\t"
	"punpckldq 64(%%esi),%%mm6\n\t"
	"pfadd %%mm6,%%mm5\n\t"
	"movd %%mm5,128(%%ebx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,2048(%%ebx)\n\t"

	"movq 8(%%eax),%%mm2\n\t"
	"movd "MANGLE(COS9)"+20,%%mm3\n\t"
	"punpckldq %%mm3,%%mm3\n\t"
	"pfmul %%mm3,%%mm2\n\t"
	"pfsub %%mm0,%%mm2\n\t"
	"movq 40(%%eax),%%mm3\n\t"
	"movd "MANGLE(COS9)"+28,%%mm4\n\t"
	"punpckldq %%mm4,%%mm4\n\t"
	"pfmul %%mm4,%%mm3\n\t"
	"pfsub %%mm3,%%mm2\n\t"
	"movq 56(%%eax),%%mm3\n\t"
	"movd "MANGLE(COS9)"+4,%%mm4\n\t"
	"punpckldq %%mm4,%%mm4\n\t"
	"pfmul %%mm4,%%mm3\n\t"
	"pfadd %%mm3,%%mm2\n\t"
	"movq (%%eax),%%mm3\n\t"
	"movq 16(%%eax),%%mm4\n\t"
	"movd "MANGLE(COS9)"+32,%%mm5\n\t"
	"punpckldq %%mm5,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"pfsub %%mm4,%%mm3\n\t"
	"movq 32(%%eax),%%mm4\n\t"
	"movd "MANGLE(COS9)"+8,%%mm5\n\t"
	"punpckldq %%mm5,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"pfsub %%mm4,%%mm3\n\t"
	"pfadd %%mm1,%%mm3\n\t"
	"movq 64(%%eax),%%mm4\n\t"
	"movd "MANGLE(COS9)"+16,%%mm5\n\t"
	"punpckldq %%mm5,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"pfadd %%mm4,%%mm3\n\t"
	"movq %%mm2,%%mm4\n\t"
	"pfadd %%mm3,%%mm4\n\t"
	"movq %%mm7,%%mm5\n\t"
	"punpckldq "MANGLE(tfcos36)"+8,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"movq %%mm4,%%mm5\n\t"
	"pfacc %%mm5,%%mm5\n\t"
	"movd 116(%%edx),%%mm6\n\t"
	"punpckldq 96(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd %%mm5,44(%%ecx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,24(%%ecx)\n\t"
	"movq %%mm4,%%mm6\n\t"
	"punpckldq %%mm6,%%mm5\n\t"
	"pfsub %%mm6,%%mm5\n\t"
	"punpckhdq %%mm5,%%mm5\n\t"
	"movd 24(%%edx),%%mm6\n\t"
	"punpckldq 44(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd 24(%%esi),%%mm6\n\t"
	"punpckldq 44(%%esi),%%mm6\n\t"
	"pfadd %%mm6,%%mm5\n\t"
	"movd %%mm5,768(%%ebx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,1408(%%ebx)\n\t"
	"movq %%mm3,%%mm4\n\t"
	"pfsub %%mm2,%%mm4\n\t"
	"movq %%mm7,%%mm5\n\t"
	"punpckldq "MANGLE(tfcos36)"+24,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"movq %%mm4,%%mm5\n\t"
	"pfacc %%mm5,%%mm5\n\t"
	"movd 132(%%edx),%%mm6\n\t"
	"punpckldq 80(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd %%mm5,60(%%ecx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,8(%%ecx)\n\t"
	"movq %%mm4,%%mm6\n\t"
	"punpckldq %%mm6,%%mm5\n\t"
	"pfsub %%mm6,%%mm5\n\t"
	"punpckhdq %%mm5,%%mm5\n\t"
	"movd 8(%%edx),%%mm6\n\t"
	"punpckldq 60(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd 8(%%esi),%%mm6\n\t"
	"punpckldq 60(%%esi),%%mm6\n\t"
	"pfadd %%mm6,%%mm5\n\t"
	"movd %%mm5,256(%%ebx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,1920(%%ebx)\n\t"
	"movq 8(%%eax),%%mm2\n\t"
	"movd "MANGLE(COS9)"+28,%%mm3\n\t"
	"punpckldq %%mm3,%%mm3\n\t"
	"pfmul %%mm3,%%mm2\n\t"
	"pfsub %%mm0,%%mm2\n\t"
	"movq 40(%%eax),%%mm3\n\t"
	"movd "MANGLE(COS9)"+4,%%mm4\n\t"
	"punpckldq %%mm4,%%mm4\n\t"
	"pfmul %%mm4,%%mm3\n\t"
	"pfadd %%mm3,%%mm2\n\t"
	"movq 56(%%eax),%%mm3\n\t"
	"movd "MANGLE(COS9)"+20,%%mm4\n\t"
	"punpckldq %%mm4,%%mm4\n\t"
	"pfmul %%mm4,%%mm3\n\t"
	"pfsub %%mm3,%%mm2\n\t"
	"movq (%%eax),%%mm3\n\t"
	"movq 16(%%eax),%%mm4\n\t"
	"movd "MANGLE(COS9)"+16,%%mm5\n\t"
	"punpckldq %%mm5,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"pfsub %%mm4,%%mm3\n\t"
	"movq 32(%%eax),%%mm4\n\t"
	"movd "MANGLE(COS9)"+32,%%mm5\n\t"
	"punpckldq %%mm5,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"pfadd %%mm4,%%mm3\n\t"
	"pfadd %%mm1,%%mm3\n\t"
	"movq 64(%%eax),%%mm4\n\t"
	"movd "MANGLE(COS9)"+8,%%mm5\n\t"
	"punpckldq %%mm5,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"pfsub %%mm4,%%mm3\n\t"
	"movq %%mm2,%%mm4\n\t"
	"pfadd %%mm3,%%mm4\n\t"
	"movq %%mm7,%%mm5\n\t"
	"punpckldq "MANGLE(tfcos36)"+12,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"movq %%mm4,%%mm5\n\t"
	"pfacc %%mm5,%%mm5\n\t"
	"movd 120(%%edx),%%mm6\n\t"
	"punpckldq 92(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd %%mm5,48(%%ecx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,20(%%ecx)\n\t"
	"movq %%mm4,%%mm6\n\t"
	"punpckldq %%mm6,%%mm5\n\t"
	"pfsub %%mm6,%%mm5\n\t"
	"punpckhdq %%mm5,%%mm5\n\t"
	"movd 20(%%edx),%%mm6\n\t"
	"punpckldq 48(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd 20(%%esi),%%mm6\n\t"
	"punpckldq 48(%%esi),%%mm6\n\t"
	"pfadd %%mm6,%%mm5\n\t"
	"movd %%mm5,640(%%ebx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,1536(%%ebx)\n\t"
	"movq %%mm3,%%mm4\n\t"
	"pfsub %%mm2,%%mm4\n\t"
	"movq %%mm7,%%mm5\n\t"
	"punpckldq "MANGLE(tfcos36)"+20,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"movq %%mm4,%%mm5\n\t"
	"pfacc %%mm5,%%mm5\n\t"
	"movd 128(%%edx),%%mm6\n\t"
	"punpckldq 84(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd %%mm5,56(%%ecx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,12(%%ecx)\n\t"
	"movq %%mm4,%%mm6\n\t"
	"punpckldq %%mm6,%%mm5\n\t"
	"pfsub %%mm6,%%mm5\n\t"
	"punpckhdq %%mm5,%%mm5\n\t"
	"movd 12(%%edx),%%mm6\n\t"
	"punpckldq 56(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd 12(%%esi),%%mm6\n\t"
	"punpckldq 56(%%esi),%%mm6\n\t"
	"pfadd %%mm6,%%mm5\n\t"
	"movd %%mm5,384(%%ebx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,1792(%%ebx)\n\t"

	"movq (%%eax),%%mm4\n\t"
	"movq 16(%%eax),%%mm3\n\t"
	"pfsub %%mm3,%%mm4\n\t"
	"movq 32(%%eax),%%mm3\n\t"
	"pfadd %%mm3,%%mm4\n\t"
	"movq 48(%%eax),%%mm3\n\t"
	"pfsub %%mm3,%%mm4\n\t"
	"movq 64(%%eax),%%mm3\n\t"
	"pfadd %%mm3,%%mm4\n\t"
	"movq %%mm7,%%mm5\n\t"
	"punpckldq "MANGLE(tfcos36)"+16,%%mm5\n\t"
	"pfmul %%mm5,%%mm4\n\t"
	"movq %%mm4,%%mm5\n\t"
	"pfacc %%mm5,%%mm5\n\t"
	"movd 124(%%edx),%%mm6\n\t"
	"punpckldq 88(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd %%mm5,52(%%ecx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,16(%%ecx)\n\t"
	"movq %%mm4,%%mm6\n\t"
	"punpckldq %%mm6,%%mm5\n\t"
	"pfsub %%mm6,%%mm5\n\t"
	"punpckhdq %%mm5,%%mm5\n\t"
	"movd 16(%%edx),%%mm6\n\t"
	"punpckldq 52(%%edx),%%mm6\n\t"
	"pfmul %%mm6,%%mm5\n\t"
	"movd 16(%%esi),%%mm6\n\t"
	"punpckldq 52(%%esi),%%mm6\n\t"
	"pfadd %%mm6,%%mm5\n\t"
	"movd %%mm5,512(%%ebx)\n\t"
	"psrlq $32,%%mm5\n\t"
	"movd %%mm5,1664(%%ebx)\n\t"

	"femms\n\t"
	:
	: "a" (inbuf), "S" (o1), "c" (o2), "d" (wintab), "b" (tsbuf)
	: "memory");
}