-
Notifications
You must be signed in to change notification settings - Fork 0
/
fft2mmxc64.s
628 lines (608 loc) · 18.1 KB
/
fft2mmxc64.s
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
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
; Copyright (c) <2012> <Leif Asbrink>
;
; Permission is hereby granted, free of charge, to any person
; obtaining a copy of this software and associated documentation
; files (the "Software"), to deal in the Software without restriction,
; including without limitation the rights to use, copy, modify,
; merge, publish, distribute, sublicense, and/or sell copies of
; the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be
; included in all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
; OR OTHER DEALINGS IN THE SOFTWARE.
%ifdef OS_LINUX
extern fft2_short_int
extern fft2_size
extern fft2_mmxcosin
extern fft2_na
extern fft2_n
extern fft2_m2
extern fft2_inc
extern mailbox
global fft2_mmx_c2
global fft2_mmx_c1
%endif
%ifdef OS_WINDOWS
extern _fft2_short_int
extern _fft2_size
extern _fft2_mmxcosin
extern _fft2_na
extern _fft2_n
extern _fft2_m2
extern _fft2_inc
global _fft2_mmx_c2
global _fft2_mmx_c1
fft2_short_int equ _fft2_short_int
fft2_size equ _fft2_size
fft2_mmxcosin equ _fft2_mmxcosin
fft2_na equ _fft2_na
fft2_n equ _fft2_n
fft2_m2 equ _fft2_m2
fft2_inc equ _fft2_inc
%endif
%define TMP1 ebp-4
%define TMP2 ebp-8
%define TMP3 ebp-12
%define TMP4 ebp-16
%define LIMIT ebp-20
%define INCC ebp-24
section .text
fft2_mmx_c1
_fft2_mmx_c1
push rbx
push rcx
push rdx
push rsi
push rdi
push rbp
;ö mov ebp,[fft2_mmxcosin]
mov eax,0FFFFH
mov [TMP1],eax
mov [TMP2],eax
mov eax,1
mov [TMP3],eax
mov [TMP4],eax
movq mm7,[TMP2]
movq mm6,[TMP4]
xor eax,eax
mov [TMP1],eax
mov [TMP3],eax
dec eax
mov [TMP2],eax
mov eax,10001H
mov [TMP4],eax
movq mm5,[TMP2]
movq mm4,[TMP4]
;ö test word [fft2_n],1
jz near dual_last_1
;ö mov eax,[fft2_size]
sal eax,2
mov [LIMIT],eax
; Base of current transform.
;zxy=&fft2_short_int[2*ui.rx_channels*fft2_na*fft2_size];
;ö mov eax,[fft2_size]
sal eax,2
;ö imul eax,[fft2_na]
;ö mov esi,[fft2_short_int]
add esi,eax
;ö mov ecx,[fft2_size]
sal ecx,1
xor edi,edi
c1b:;
; ss1= fft2_tab[itab].sin;
; cs1= fft2_tab[itab].cos;
movq mm0,[ebp+edi] ;mm0 = cs1 -ss1 ss1 cs1
; x1=fft1_tmp[4*ia ];
; y1=fft1_tmp[4*ia+1];
mov eax,[esi+ecx]
mov [TMP1],eax
mov [TMP2],eax
;mm0 = c1 -s1 s1 c1
movq mm2,[TMP2] ;mm1 = y1 x1 y1 x1
; t1= c1*x1+s1*y1;
; t2= c1*y1-s1*x1;
pmaddwd mm2,mm0 ;mm2 = c1*y1-s1*x1 c1*x1+s1*y1
psrad mm2,16 ;mm2 = t2 t1
packssdw mm2,mm2 ;mm2 = t2 t1 t2 t1
; x0=fft1_tmp[4*ia ];
; y0=fft1_tmp[4*ia+1];
mov eax,[esi]
mov [TMP1],eax
mov [TMP2],eax
movq mm1,[TMP2] ;mm1 = y0 x0 y0 x0
psraw mm1,1
pxor mm2,mm5
paddsw mm2,mm4 ;mm2 = -t2 -t1 t2 t1
; zxy[ib ]=(x0-t1)/4;
; zxy[ib+1]=-(y0-t2)/4;
; zxy[ia ]=(x0+t1)/4;
; zxy[ia+1]=-(y0+t2)/4;
paddsw mm1,mm2
movq [TMP2],mm1
mov eax,[TMP2]
mov ebx,[TMP1]
neg ax
neg bx
mov [esi],ebx
mov [esi+ecx],eax
add edi,8
add esi,4
cmp edi,[LIMIT]
jb near c1b
emms
pop rbp
pop rdi
pop rsi
pop rdx
pop rcx
pop rbx
ret
dual_last_1:
xor eax,eax
mov [TMP1],eax
mov [TMP3],eax
dec eax
mov [TMP2],eax
movq mm7,[TMP2]
movq mm6,[TMP3]
;ö mov eax,[fft2_size]
sal eax,1
mov [LIMIT],eax
; Base of current transform.
;zxy=&fft2_short_int[2*ui.rx_channels*fft2_na*fft2_size];
;ö mov eax,[fft2_size]
sal eax,2
;ö imul eax,[fft2_na]
;ö mov esi,[fft2_short_int]
add esi,eax
;ö mov ecx,[fft2_size]
xor edi,edi
c1a:;
; ss1= fft2_tab[2*itab].sin;
; cs1= fft2_tab[2*itab].cos;
movq mm0,[ebp+2*edi] ;mm0 = cs1 -ss1 ss1 cs1
; ib=ia+m2;
; x1=zxy[ib ];
; y1=zxy[ib+1];
mov eax,[esi+ecx] ;ib
mov [TMP1],eax
mov [TMP2],eax
movq mm1,[TMP2] ;mm1 = y1 x1 y1 x1
; t1=cs1*x1+ss1*y1;
; t2=cs1*y1-ss1*x1;
pmaddwd mm1,mm0 ;mm1 = c1*y1-s1*x1 c1*x1+s1*y1
add esi,ecx
;mm1 = t2 t1
psrad mm1,16 ;mm1 = . t2 . t1
packssdw mm1,mm1 ;mm1 = t2 t1 t2 t1
pand mm1,mm7 ;mm1 = 0 0 t2 t1
; x3=zxy[id ];
; y3=zxy[id+1];
mov eax,[esi+2*ecx] ;id
mov [TMP1],eax
mov [TMP2],eax
movq mm2,[TMP2] ;mm2 = y3 x3 y3 x3
; t3=cs1*x3+ss1*y3;
; t4=cs1*y3-ss1*x3;
pmaddwd mm2,mm0 ;mm2 = c1*y3-s1*x3 c1*x3+s1*y3
sub esi,ecx
psrad mm2,16 ;mm2 = . t4 . t3
packssdw mm2,mm2 ;mm2 = t4 t3 t4 t3
pand mm2,mm6 ;mm2 = t4 t3 0 0
paddsw mm1,mm2 ;mm1 = t4 t3 t2 t1
; x0=zxy[ia ];
; y0=zxy[ia+1];
; x2=zxy[ic ];
; y2=zxy[ic+1];
mov eax,[esi] ;ia
mov [TMP2],eax
mov ebx,[esi+2*ecx] ;ic
mov [TMP1],ebx
movq mm0,[TMP2] ;mm0 = y2 x2 y0 x0
psraw mm0,1
movq mm2,mm0
; x4=x0+t1;
; y4=y0+t2;
; x5=x2+t3;
; y5=y2+t4;
;
; x6=x0-t1;
; y6=y0-t2;
; x7=x2-t3;
; y7=y2-t4;
paddsw mm0,mm1 ;mm0 = y5 x5 y4 x4
psubsw mm2,mm1 ;mm2 = y7 x7 y6 x6
; ss2= fft2_tab[itab].sin;
; cs2= fft2_tab[itab].cos;
movq mm1,[ebp+edi] ;mm1 = cs2 -ss2 ss2 cs2
; t5=cs2*x5+ss2*y5;
; t6=cs2*y5-ss2*x5;
movq mm3,mm0 ;mm3 = y5 x5 y4 x4
movq mm5,mm0 ;mm5 = y5 x5 y4 x4
psraw mm5,1
pand mm3,mm6 ;mm3 = y5 x5 0 0
psrlq mm0,32 ;mm0 = 0 0 y5 x5
paddsw mm0,mm3 ;mm0 = y5 x5 y5 x5
pmaddwd mm0,mm1 ;mm0 = t6 t5
movq mm4,mm5
psrad mm0,16 ;mm0 = t6 t5
packssdw mm0,mm0 ;mm1 = t6 t5 t6 t5
; zxy[ia ]=x4+t5;
; zxy[ia+1]=y4+t6;
; zxy[ic ]=x4-t5;
; zxy[ic+1]=y4-t6;
paddsw mm5,mm0
psubsw mm4,mm0
movq [TMP2],mm5
movq [TMP4],mm4
mov eax,[TMP2]
mov ebx,[TMP4]
neg ax
neg bx
mov [esi],eax
mov [esi+2*ecx],ebx
; t8=cs2*x7+ss2*y7;
; t7=cs2*y7-ss2*x7;
movq mm5,mm2 ;mm5 = y7 x7 y6 x6
movq mm4,mm2 ;mm4 = y7 x7 y6 x6
psraw mm4,1
pand mm5,mm6 ;mm5 = y7 x7 0 0
psrlq mm2,32 ;mm2 = 0 0 y7 x7
paddsw mm2,mm5 ;mm2 = y7 x7 y7 x7
pmaddwd mm2,mm1 ;mm2 = t7 t8
add esi,ecx
psrad mm2,16 ;mm2 = . t7 . t8
movq mm3,mm4 ;mm3 = y7 x7 y6 x6
movq mm1,mm2 ;mm1 = . t7 . t8
psrlq mm1,16 ;mm1 = 0 . t7 .
psrld mm1,16 ;mm1 = 0 0 0 t7
pslld mm2,16 ;mm2 = . . t8 0
psubsw mm1,mm2 ;mm1 = . . t7 -t8
; zxy[ib ]=x6+t7;
; zxy[ib+1]=y6-t8;
; zxy[id ]=x6-t7;
; zxy[id+1]=y6+t8;
paddsw mm4,mm1
psubsw mm3,mm1
movq [TMP2],mm4
movq [TMP4],mm3
mov eax,[TMP2]
mov ebx,[TMP4]
neg ax
neg bx
mov [esi],eax
mov [esi+2*ecx],ebx
sub esi,ecx
; itab+=inc;
; ia+=2;
; if(itab<siz_d4)goto xlp1;
add edi,8
add esi,4
cmp edi,[LIMIT]
jb near c1a
zz:
emms
pop rbp
pop rdi
pop rsi
pop rdx
pop rcx
pop rbx
ret
fft2_mmx_c2
_fft2_mmx_c2
push rbx
push rcx
push rdx
push rsi
push rdi
push rbp
;ö mov ebp,[fft2_mmxcosin]
mov eax,0FFFFH
mov [TMP1],eax
mov [TMP2],eax
mov eax,1
mov [TMP3],eax
mov [TMP4],eax
;ö test word [fft2_n],1
jz near dual_last_2
;ö mov eax,[fft2_size]
sal eax,2
mov [LIMIT],eax
; Base of current transform.
;zxy=&fft2_short_int[2*ui.rx_channels*fft2_na*fft2_size];
;ö mov eax,[fft2_size]
sal eax,3
;ö imul eax,[fft2_na]
;ö mov esi,[fft2_short_int]
add esi,eax
;ö mov ecx,[fft2_size]
sal ecx,2
xor edi,edi
c2b:;
; ss1= fft2_tab[itab].sin;
; cs1= fft2_tab[itab].cos;
movq mm0,[ebp+edi] ;mm0 = cs1 -ss1 ss1 cs1
; x0=fft1_tmp[4*ia ];
; y0=fft1_tmp[4*ia+1];
; u0=fft1_tmp[4*ia+2];
; w0=fft1_tmp[4*ia+3];
; ia+=m1;
; x1=fft1_tmp[4*ia ];
; y1=fft1_tmp[4*ia+1];
; u1=fft1_tmp[4*ia+2];
; w1=fft1_tmp[4*ia+3];
;mm0 = c1 -s1 s1 c1
movq mm1,[esi] ;mm1 = w0 u0 y0 x0
movq mm2,[esi+ecx ] ;mm2 = w1 u1 y1 x1
movq mm4,mm2 ;mm4 = w1 u1 y1 x1
; t1= c1*x1+s1*y1;
; t2= c1*y1-s1*x1;
; r1= c1*u1+s1*w1;
; r2= c1*w1-s1*u1;
punpckldq mm2,mm2 ;mm2 = y1 x1 y1 x1
punpckhdq mm4,mm4 ;mm4 = w1 u1 w1 u1
pmaddwd mm2,mm0 ;mm2 = c1*y1-s1*x1 c1*x1+s1*y1
pmaddwd mm4,mm0 ;mm4 = c1*w1-s1*u1 c1*u1+s1*w1
psraw mm1,1
movq mm6,mm1 ;mm6 = w0 u0 y0 x0
psrad mm2,16 ;mm2 = t2 t1
psrad mm4,16 ;mm4 = r2 r1
packssdw mm2,mm4 ;mm2 = r2 r1 t2 t1
; zxy[ib ]=(x0-t1)/4;
; zxy[ib+1]=-(y0-t2)/4;
; zxy[ib+2]=(u0-r1)/4;
; zxy[ib+3]=-(w0-r2)/4;
; zxy[ia ]=(x0+t1)/4;
; zxy[ia+1]=-(y0+t2)/4;
; zxy[ia+2]=(u0+r1)/4;
; zxy[ia+3]=-(w0+r2)/4;
paddsw mm1,mm2
psubsw mm6,mm2
pxor mm1,[TMP2]
paddsw mm1,[TMP4]
pxor mm6,[TMP2]
paddsw mm6,[TMP4]
movq [esi],mm1
movq [esi+ecx],mm6
add edi,8
add esi,8
cmp edi,[LIMIT]
jb near c2b
emms
pop rbp
pop rdi
pop rsi
pop rdx
pop rcx
pop rbx
ret
dual_last_2:
;ö mov eax,[fft2_size]
sal eax,1
mov [LIMIT],eax
; Base of current transform.
;zxy=&fft2_short_int[2*ui.rx_channels*fft2_na*fft2_size];
;ö mov eax,[fft2_size]
sal eax,3
;ö imul eax,[fft2_na]
;ö mov esi,[fft2_short_int]
add esi,eax
;ö mov ecx,[fft2_size]
sal ecx,1
xor edi,edi
c2a:;
;jmp c2a
; ss1= fft2_tab[2*itab].sin;
; cs1= fft2_tab[2*itab].cos;
movq mm0,[ebp+2*edi] ;mm0 = cs1 -ss1 ss1 cs1
; x0=fft1_tmp[4*ia ];
; y0=fft1_tmp[4*ia+1];
; u0=fft1_tmp[4*ia+2];
; w0=fft1_tmp[4*ia+3];
; ia+=m1;
; x1=fft1_tmp[4*ia ];
; y1=fft1_tmp[4*ia+1];
; u1=fft1_tmp[4*ia+2];
; w1=fft1_tmp[4*ia+3];
;mm0 = c1 -s1 s1 c1
movq mm1,[esi] ;mm1 = w0 u0 y0 x0
movq mm2,[esi+ecx ] ;mm2 = w1 u1 y1 x1
; x2=zxy[ic ];
; y2=zxy[ic+1];
; u2=zxy[ic+2];
; w2=zxy[ic+3];
movq mm3,[esi+2*ecx] ;mm3 = w2 u2 y2 x2
add esi,ecx
movq mm4,mm2 ;mm4 = w1 u1 y1 x1
; t1= c1*x1+s1*y1;
; t2= c1*y1-s1*x1;
; r1= c1*u1+s1*w1;
; r2= c1*w1-s1*u1;
punpckldq mm2,mm2 ;mm2 = y1 x1 y1 x1
punpckhdq mm4,mm4 ;mm4 = w1 u1 w1 u1
pmaddwd mm2,mm0 ;mm2 = c1*y1-s1*x1 c1*x1+s1*y1
pmaddwd mm4,mm0 ;mm4 = c1*w1-s1*u1 c1*u1+s1*w1
psraw mm1,1
movq mm6,mm1 ;mm6 = w0 u0 y0 x0
psrad mm2,16 ;mm2 = t2 t1
psrad mm4,16 ;mm4 = r2 r1
packssdw mm2,mm4 ;mm2 = r2 r1 t2 t1
; x3=zxy[id ];
; y3=zxy[id+1];
; u3=zxy[id+2];
; w3=zxy[id+3];
movq mm7,[esi+2*ecx] ;mm7 = w3 u3 y3 x3
; x4=x0+t1;
; y4=y0+t2;
; u4=u0+r1;
; w4=w0+r2;
;
; x6=x0-t1;
; y6=y0-t2;
; u6=u0-r1;
; w6=w0-r2;
;mm0 = c1 -s1 s1 c1
;mm1 = w0 u0 y0 x0
;mm2 = r2 r1 t2 t1
;mm3 = w2 u2 y2 x2
;mm4 = ?
;mm5 = ?
;mm6 = w0 u0 y0 x0
;mm7 = w3 u3 y3 x3
paddsw mm1,mm2 ;mm1 = w4 u4 y4 x4
psubsw mm6,mm2 ;mm6 = w6 u6 y6 x6
; t3=c1*x3+s1*y3;
; t4=c1*y3-s1*x3;
; r3=c1*u3+s1*w3;
; r4=c1*w3-s1*u3;
;mm0 = c1 -s1 s1 c1
movq mm5,mm7 ;mm5 = w3 u3 y3 x3
punpckldq mm7,mm7 ;mm7 = y3 x3 y3 x3
punpckhdq mm5,mm5 ;mm5 = w3 u3 w3 u3
pmaddwd mm7,mm0 ;mm7 = c1*y3-s1*x3 c1*x3+s1*y3
pmaddwd mm5,mm0 ;mm5 = c1*w3-s1*u3 c1*u3+s1*w3
;mm7 = t4 t3
;mm5 = r4 r3
sub esi,ecx
psrad mm7,16 ;mm7 = t4 t3
psrad mm5,16 ;mm5 = r4 r3
packssdw mm7,mm5 ;mm7 = r4 r3 t4 t3
; x5=x2+t3;
; y5=y2+t4;
; u5=u2+r3;
; w5=w2+r4;
;
; x7=x2-t3;
; y7=y2-t4;
; u7=u2-r3;
; w7=w2-r4;
;mm0 = c1 -s1 s1 c1
;mm1 = w4 u4 y4 x4
;mm2 = ?
;mm3 = w2 u2 y2 x2
;mm4 = ?
;mm5 = r4 r3
;mm6 = w6 u6 y6 x6
;mm7 = t4 t3
psraw mm3,1
movq mm5,mm3 ;mm5 = w2 u2 y2 x2
paddsw mm3,mm7 ;mm3 = w5 u5 y5 x5
psubsw mm5,mm7 ;mm5 = w7 u7 y7 x7
;mm0 = c1 -s1 s1 c1
;mm1 = w4 u4 y4 x4
;mm2 = ?
;mm3 = w5 u5 y5 x5
;mm4 = ?
;mm5 = w7 u7 y7 x7
;mm6 = w6 u6 y6 x6
;mm7 = ?
movq mm0,[ebp+edi] ;mm0 = c2 -s2 s2 c2
; t5=c2*x5+s2*y5;
; t6=c2*y5-s2*x5;
; r5=c2*u5+s2*w5;
; r6=c2*w5-s2*u5;
movq mm2,mm3 ;mm2 = w5 u5 y5 x5
punpckldq mm3,mm3 ;mm3 = y5 x5 y5 x5
punpckhdq mm2,mm2 ;mm2 = w5 u5 w5 u5
pmaddwd mm3,mm0 ;mm3 = c2*y5-s2*x5 c2*x5+s2*y5
pmaddwd mm2,mm0 ;mm2 = c2*w5-s2*u5 c2*u5+s2*w5
movq mm4,mm3 ;mm3 = t6 t5
movq mm7,mm2 ;mm2 = r6 r5
psrad mm3,16 ;mm3 = t6 t5
psrad mm2,16 ;mm2 = r6 r5
packssdw mm3,mm2 ;mm3 = r6 r5 t6 t5
psraw mm1,1
movq mm7,mm1 ;mm7 = w4 u4 y4 x4
paddsw mm1,mm3 ;mm1 = w4+r6 u4+r5 y4+t6 x4+t5
psubsw mm7,mm3 ;mm7 = w4-r6 u4-r5 y4-t6 x4-t5
pxor mm1,[TMP2]
paddsw mm1,[TMP4]
pxor mm7,[TMP2]
paddsw mm7,[TMP4]
; zxy[ia ]=(x4+t5);
; zxy[ia+1]=-(y4+t6);
; zxy[ia+2]=(u4+r5);
; zxy[ia+3]=-(w4+r6);
; zxy[ic ]=(x4-t5);
; zxy[ic+1]=-(y4-t6);
; zxy[ic+2]=(u4-r5);
; zxy[ic+3]=-(w4-r6);
movq [esi],mm1
movq [esi+2*ecx],mm7
;mm0 = c1 -s1 s1 c1
;mm1 = ?
;mm2 = ?
;mm3 = ?
;mm4 = ?
;mm5 = w7 u7 y7 x7
;mm6 = w6 u6 y6 x6
;mm7 = ?
; t7=cs2*y7-ss2*x7;
; t8=cs2*x7+ss2*y7;
; r7=cs2*w7-ss2*u7;
; r8=cs2*u7+ss2*w7;
; zxy[ib ]=(x6+t7);
; zxy[ib+1]=-(y6-t8);
; zxy[ib+2]=(u6+r7);
; zxy[ib+3]=-(w6-r8);
; zxy[id ]=(x6-t7);
; zxy[id+1]=-(y6+t8);
; zxy[id+2]=(u6-r7);
; zxy[id+3]=-(w6+r8);
movq mm2,mm5 ;mm2 = w7 u7 y7 x7
punpckldq mm5,mm5 ;mm5 = y7 x7 y7 x7
punpckhdq mm2,mm2 ;mm2 = w7 u7 w7 u7
pmaddwd mm5,mm0 ;mm5 = c2*y7-s2*x7 c2*x7+s2*y7
pmaddwd mm2,mm0 ;mm2 = c2*w7-s2*u7 c2*u7+s2*w7
;mm5 = t7 t8
;mm2 = r7 r8
psrad mm5,16 ;mm5 = t7 t8
psrad mm2,16 ;mm2 = r7 r8
movq mm4,mm5
movq mm3,mm2
pxor mm0,mm0
punpckldq mm5,mm0 ;mm5 = t8
punpckldq mm2,mm0 ;mm2 = r8
punpckhdq mm4,mm0 ;mm4 = t7
punpckhdq mm3,mm0 ;mm3 = r7
packssdw mm4,mm3 ;mm4 = r7 t7
packssdw mm5,mm2 ;mm5 = r8 t8
psllq mm5,16 ;mm5 = r8 t8
psubsw mm4,mm5 ;mm4 = -r8 r7 -t8 t7
psraw mm6,1
movq mm7,mm6 ;mm7 = w6 u6 y6 x6
paddsw mm6,mm4
psubsw mm7,mm4
add esi,ecx
pxor mm6,[TMP2]
paddsw mm6,[TMP4]
pxor mm7,[TMP2]
paddsw mm7,[TMP4]
movq [esi],mm6
movq [esi+2*ecx],mm7
sub esi,ecx
; itab+=inc;
; ia+=2;
; if(itab<siz_d4)goto xlp1;
add edi,8
add esi,8
cmp edi,[LIMIT]
jb near c2a
emms
pop rbp
pop rdi
pop rsi
pop rdx
pop rcx
pop rbx
ret