annotate i386/fft_mmx.asm @ 7885:f874e1d5cf07 libavcodec

Factorize out code used for MS RLE format decoding in different decoders.
author kostya
date Thu, 18 Sep 2008 05:20:54 +0000
parents a8a8205a9081
children 4877d4c6d8ae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7542
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
1 ;******************************************************************************
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
2 ;* FFT transform with SSE/3DNow optimizations
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
3 ;* Copyright (c) 2008 Loren Merritt
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
4 ;*
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
5 ;* This file is part of FFmpeg.
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
6 ;*
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
7 ;* FFmpeg is free software; you can redistribute it and/or
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
8 ;* modify it under the terms of the GNU Lesser General Public
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
9 ;* License as published by the Free Software Foundation; either
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
10 ;* version 2.1 of the License, or (at your option) any later version.
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
11 ;*
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
12 ;* FFmpeg is distributed in the hope that it will be useful,
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
13 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
14 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
15 ;* Lesser General Public License for more details.
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
16 ;*
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
17 ;* You should have received a copy of the GNU Lesser General Public
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
18 ;* License along with FFmpeg; if not, write to the Free Software
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
19 ;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
20 ;******************************************************************************
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
21
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
22 ; These functions are not individually interchangeable with the C versions.
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
23 ; While C takes arrays of FFTComplex, SSE/3DNow leave intermediate results
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
24 ; in blocks as conventient to the vector size.
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
25 ; i.e. {4x real, 4x imaginary, 4x real, ...} (or 2x respectively)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
26
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
27 %include "x86inc.asm"
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
28
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
29 SECTION_RODATA
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
30
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
31 %define M_SQRT1_2 0.70710678118654752440
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
32 ps_root2: times 4 dd M_SQRT1_2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
33 ps_root2mppm: dd -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, -M_SQRT1_2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
34 ps_m1p1: dd 1<<31, 0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
35
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
36 %assign i 16
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
37 %rep 13
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
38 cextern ff_cos_ %+ i
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
39 %assign i i<<1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
40 %endrep
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
41
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
42 %ifdef ARCH_X86_64
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
43 %define pointer dq
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
44 %else
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
45 %define pointer dd
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
46 %endif
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
47
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
48 %macro IF0 1+
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
49 %endmacro
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
50 %macro IF1 1+
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
51 %1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
52 %endmacro
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
53
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
54 section .text align=16
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
55
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
56 %macro T2_3DN 4 ; z0, z1, mem0, mem1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
57 mova %1, %3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
58 mova %2, %1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
59 pfadd %1, %4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
60 pfsub %2, %4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
61 %endmacro
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
62
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
63 %macro T4_3DN 6 ; z0, z1, z2, z3, tmp0, tmp1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
64 mova %5, %3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
65 pfsub %3, %4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
66 pfadd %5, %4 ; {t6,t5}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
67 pxor %3, [ps_m1p1 GLOBAL] ; {t8,t7}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
68 mova %6, %1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
69 pswapd %3, %3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
70 pfadd %1, %5 ; {r0,i0}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
71 pfsub %6, %5 ; {r2,i2}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
72 mova %4, %2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
73 pfadd %2, %3 ; {r1,i1}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
74 pfsub %4, %3 ; {r3,i3}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
75 SWAP %3, %6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
76 %endmacro
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
77
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
78 ; in: %1={r0,i0,r1,i1} %2={r2,i2,r3,i3}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
79 ; out: %1={r0,r1,r2,r3} %2={i0,i1,i2,i3}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
80 %macro T4_SSE 3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
81 mova %3, %1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
82 shufps %1, %2, 0x64 ; {r0,i0,r3,i2}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
83 shufps %3, %2, 0xce ; {r1,i1,r2,i3}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
84 mova %2, %1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
85 addps %1, %3 ; {t1,t2,t6,t5}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
86 subps %2, %3 ; {t3,t4,t8,t7}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
87 mova %3, %1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
88 shufps %1, %2, 0x44 ; {t1,t2,t3,t4}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
89 shufps %3, %2, 0xbe ; {t6,t5,t7,t8}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
90 mova %2, %1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
91 addps %1, %3 ; {r0,i0,r1,i1}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
92 subps %2, %3 ; {r2,i2,r3,i3}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
93 mova %3, %1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
94 shufps %1, %2, 0x88 ; {r0,r1,r2,r3}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
95 shufps %3, %2, 0xdd ; {i0,i1,i2,i3}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
96 SWAP %2, %3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
97 %endmacro
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
98
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
99 %macro T8_SSE 6 ; r0,i0,r1,i1,t0,t1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
100 mova %5, %3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
101 shufps %3, %4, 0x44 ; {r4,i4,r6,i6}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
102 shufps %5, %4, 0xee ; {r5,i5,r7,i7}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
103 mova %6, %3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
104 subps %3, %5 ; {r5,i5,r7,i7}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
105 addps %6, %5 ; {t1,t2,t3,t4}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
106 mova %5, %3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
107 shufps %5, %5, 0xb1 ; {i5,r5,i7,r7}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
108 mulps %3, [ps_root2mppm GLOBAL] ; {-r5,i5,r7,-i7}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
109 mulps %5, [ps_root2 GLOBAL]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
110 addps %3, %5 ; {t8,t7,ta,t9}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
111 mova %5, %6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
112 shufps %6, %3, 0x36 ; {t3,t2,t9,t8}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
113 shufps %5, %3, 0x9c ; {t1,t4,t7,ta}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
114 mova %3, %6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
115 addps %6, %5 ; {t1,t2,t9,ta}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
116 subps %3, %5 ; {t6,t5,tc,tb}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
117 mova %5, %6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
118 shufps %6, %3, 0xd8 ; {t1,t9,t5,tb}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
119 shufps %5, %3, 0x8d ; {t2,ta,t6,tc}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
120 mova %3, %1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
121 mova %4, %2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
122 addps %1, %6 ; {r0,r1,r2,r3}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
123 addps %2, %5 ; {i0,i1,i2,i3}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
124 subps %3, %6 ; {r4,r5,r6,r7}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
125 subps %4, %5 ; {i4,i5,i6,i7}
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
126 %endmacro
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
127
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
128 ; scheduled for cpu-bound sizes
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
129 %macro PASS_SMALL 3 ; (to load m4-m7), wre, wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
130 IF%1 mova m4, Z(4)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
131 IF%1 mova m5, Z(5)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
132 mova m0, %2 ; wre
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
133 mova m2, m4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
134 mova m1, %3 ; wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
135 mova m3, m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
136 mulps m2, m0 ; r2*wre
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
137 IF%1 mova m6, Z(6)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
138 mulps m3, m1 ; i2*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
139 IF%1 mova m7, Z(7)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
140 mulps m4, m1 ; r2*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
141 mulps m5, m0 ; i2*wre
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
142 addps m2, m3 ; r2*wre + i2*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
143 mova m3, m1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
144 mulps m1, m6 ; r3*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
145 subps m5, m4 ; i2*wre - r2*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
146 mova m4, m0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
147 mulps m3, m7 ; i3*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
148 mulps m4, m6 ; r3*wre
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
149 mulps m0, m7 ; i3*wre
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
150 subps m4, m3 ; r3*wre - i3*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
151 mova m3, Z(0)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
152 addps m0, m1 ; i3*wre + r3*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
153 mova m1, m4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
154 addps m4, m2 ; t5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
155 subps m1, m2 ; t3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
156 subps m3, m4 ; r2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
157 addps m4, Z(0) ; r0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
158 mova m6, Z(2)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
159 mova Z(4), m3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
160 mova Z(0), m4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
161 mova m3, m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
162 subps m5, m0 ; t4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
163 mova m4, m6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
164 subps m6, m5 ; r3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
165 addps m5, m4 ; r1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
166 mova Z(6), m6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
167 mova Z(2), m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
168 mova m2, Z(3)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
169 addps m3, m0 ; t6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
170 subps m2, m1 ; i3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
171 mova m7, Z(1)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
172 addps m1, Z(3) ; i1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
173 mova Z(7), m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
174 mova Z(3), m1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
175 mova m4, m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
176 subps m7, m3 ; i2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
177 addps m3, m4 ; i0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
178 mova Z(5), m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
179 mova Z(1), m3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
180 %endmacro
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
181
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
182 ; scheduled to avoid store->load aliasing
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
183 %macro PASS_BIG 1 ; (!interleave)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
184 mova m4, Z(4) ; r2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
185 mova m5, Z(5) ; i2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
186 mova m2, m4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
187 mova m0, [wq] ; wre
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
188 mova m3, m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
189 mova m1, [wq+o1q] ; wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
190 mulps m2, m0 ; r2*wre
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
191 mova m6, Z(6) ; r3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
192 mulps m3, m1 ; i2*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
193 mova m7, Z(7) ; i3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
194 mulps m4, m1 ; r2*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
195 mulps m5, m0 ; i2*wre
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
196 addps m2, m3 ; r2*wre + i2*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
197 mova m3, m1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
198 mulps m1, m6 ; r3*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
199 subps m5, m4 ; i2*wre - r2*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
200 mova m4, m0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
201 mulps m3, m7 ; i3*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
202 mulps m4, m6 ; r3*wre
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
203 mulps m0, m7 ; i3*wre
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
204 subps m4, m3 ; r3*wre - i3*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
205 mova m3, Z(0)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
206 addps m0, m1 ; i3*wre + r3*wim
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
207 mova m1, m4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
208 addps m4, m2 ; t5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
209 subps m1, m2 ; t3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
210 subps m3, m4 ; r2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
211 addps m4, Z(0) ; r0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
212 mova m6, Z(2)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
213 mova Z(4), m3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
214 mova Z(0), m4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
215 mova m3, m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
216 subps m5, m0 ; t4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
217 mova m4, m6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
218 subps m6, m5 ; r3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
219 addps m5, m4 ; r1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
220 IF%1 mova Z(6), m6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
221 IF%1 mova Z(2), m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
222 mova m2, Z(3)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
223 addps m3, m0 ; t6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
224 subps m2, m1 ; i3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
225 mova m7, Z(1)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
226 addps m1, Z(3) ; i1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
227 IF%1 mova Z(7), m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
228 IF%1 mova Z(3), m1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
229 mova m4, m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
230 subps m7, m3 ; i2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
231 addps m3, m4 ; i0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
232 IF%1 mova Z(5), m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
233 IF%1 mova Z(1), m3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
234 %if %1==0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
235 mova m4, m5 ; r1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
236 mova m0, m6 ; r3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
237 unpcklps m5, m1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
238 unpckhps m4, m1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
239 unpcklps m6, m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
240 unpckhps m0, m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
241 mova m1, Z(0)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
242 mova m2, Z(4)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
243 mova Z(2), m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
244 mova Z(3), m4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
245 mova Z(6), m6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
246 mova Z(7), m0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
247 mova m5, m1 ; r0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
248 mova m4, m2 ; r2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
249 unpcklps m1, m3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
250 unpckhps m5, m3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
251 unpcklps m2, m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
252 unpckhps m4, m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
253 mova Z(0), m1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
254 mova Z(1), m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
255 mova Z(4), m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
256 mova Z(5), m4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
257 %endif
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
258 %endmacro
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
259
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
260 %macro PUNPCK 3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
261 mova %3, %1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
262 punpckldq %1, %2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
263 punpckhdq %3, %2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
264 %endmacro
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
265
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
266 INIT_XMM
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
267
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
268 %define Z(x) [r0+mmsize*x]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
269
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
270 align 16
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
271 fft4_sse:
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
272 mova m0, Z(0)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
273 mova m1, Z(1)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
274 T4_SSE m0, m1, m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
275 mova Z(0), m0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
276 mova Z(1), m1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
277 ret
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
278
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
279 align 16
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
280 fft8_sse:
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
281 mova m0, Z(0)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
282 mova m1, Z(1)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
283 T4_SSE m0, m1, m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
284 mova m2, Z(2)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
285 mova m3, Z(3)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
286 T8_SSE m0, m1, m2, m3, m4, m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
287 mova Z(0), m0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
288 mova Z(1), m1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
289 mova Z(2), m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
290 mova Z(3), m3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
291 ret
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
292
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
293 align 16
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
294 fft16_sse:
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
295 mova m0, Z(0)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
296 mova m1, Z(1)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
297 T4_SSE m0, m1, m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
298 mova m2, Z(2)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
299 mova m3, Z(3)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
300 T8_SSE m0, m1, m2, m3, m4, m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
301 mova m4, Z(4)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
302 mova m5, Z(5)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
303 mova Z(0), m0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
304 mova Z(1), m1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
305 mova Z(2), m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
306 mova Z(3), m3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
307 T4_SSE m4, m5, m6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
308 mova m6, Z(6)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
309 mova m7, Z(7)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
310 T4_SSE m6, m7, m0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
311 PASS_SMALL 0, [ff_cos_16 GLOBAL], [ff_cos_16+16 GLOBAL]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
312 ret
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
313
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
314
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
315 INIT_MMX
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
316
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
317 %macro FFT48_3DN 1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
318 align 16
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
319 fft4%1:
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
320 T2_3DN m0, m1, Z(0), Z(1)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
321 mova m2, Z(2)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
322 mova m3, Z(3)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
323 T4_3DN m0, m1, m2, m3, m4, m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
324 PUNPCK m0, m1, m4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
325 PUNPCK m2, m3, m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
326 mova Z(0), m0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
327 mova Z(1), m4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
328 mova Z(2), m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
329 mova Z(3), m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
330 ret
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
331
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
332 align 16
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
333 fft8%1:
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
334 T2_3DN m0, m1, Z(0), Z(1)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
335 mova m2, Z(2)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
336 mova m3, Z(3)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
337 T4_3DN m0, m1, m2, m3, m4, m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
338 mova Z(0), m0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
339 mova Z(2), m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
340 T2_3DN m4, m5, Z(4), Z(5)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
341 T2_3DN m6, m7, Z(6), Z(7)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
342 pswapd m0, m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
343 pswapd m2, m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
344 pxor m0, [ps_m1p1 GLOBAL]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
345 pxor m2, [ps_m1p1 GLOBAL]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
346 pfsub m5, m0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
347 pfadd m7, m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
348 pfmul m5, [ps_root2 GLOBAL]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
349 pfmul m7, [ps_root2 GLOBAL]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
350 T4_3DN m1, m3, m5, m7, m0, m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
351 mova Z(5), m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
352 mova Z(7), m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
353 mova m0, Z(0)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
354 mova m2, Z(2)
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
355 T4_3DN m0, m2, m4, m6, m5, m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
356 PUNPCK m0, m1, m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
357 PUNPCK m2, m3, m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
358 mova Z(0), m0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
359 mova Z(1), m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
360 mova Z(2), m2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
361 mova Z(3), m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
362 PUNPCK m4, Z(5), m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
363 PUNPCK m6, Z(7), m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
364 mova Z(4), m4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
365 mova Z(5), m5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
366 mova Z(6), m6
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
367 mova Z(7), m7
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
368 ret
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
369 %endmacro
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
370
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
371 FFT48_3DN _3dn2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
372
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
373 %macro pswapd 2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
374 %ifidn %1, %2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
375 movd [r0+12], %1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
376 punpckhdq %1, [r0+8]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
377 %else
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
378 movq %1, %2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
379 psrlq %1, 32
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
380 punpckldq %1, %2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
381 %endif
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
382 %endmacro
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
383
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
384 FFT48_3DN _3dn
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
385
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
386
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
387 %define Z(x) [zq + o1q*(x&6)*((x/6)^1) + o3q*(x/6) + mmsize*(x&1)]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
388
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
389 %macro DECL_PASS 2+ ; name, payload
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
390 align 16
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
391 %1:
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
392 DEFINE_ARGS z, w, n, o1, o3
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
393 lea o3q, [nq*3]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
394 lea o1q, [nq*8]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
395 shl o3q, 4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
396 .loop:
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
397 %2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
398 add zq, mmsize*2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
399 add wq, mmsize
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
400 sub nd, mmsize/8
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
401 jg .loop
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
402 rep ret
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
403 %endmacro
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
404
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
405 INIT_XMM
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
406 DECL_PASS pass_sse, PASS_BIG 1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
407 DECL_PASS pass_interleave_sse, PASS_BIG 0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
408
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
409 INIT_MMX
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
410 %define mulps pfmul
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
411 %define addps pfadd
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
412 %define subps pfsub
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
413 %define unpcklps punpckldq
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
414 %define unpckhps punpckhdq
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
415 DECL_PASS pass_3dn, PASS_SMALL 1, [wq], [wq+o1q]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
416 DECL_PASS pass_interleave_3dn, PASS_BIG 0
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
417 %define pass_3dn2 pass_3dn
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
418 %define pass_interleave_3dn2 pass_interleave_3dn
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
419
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
420
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
421 %macro DECL_FFT 2-3 ; nbits, cpu, suffix
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
422 %xdefine list_of_fft fft4%2, fft8%2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
423 %if %1==5
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
424 %xdefine list_of_fft list_of_fft, fft16%2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
425 %endif
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
426
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
427 %assign n 1<<%1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
428 %rep 17-%1
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
429 %assign n2 n/2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
430 %assign n4 n/4
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
431 %xdefine list_of_fft list_of_fft, fft %+ n %+ %3%2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
432
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
433 align 16
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
434 fft %+ n %+ %3%2:
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
435 call fft %+ n2 %+ %2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
436 add r0, n*4 - (n&(-2<<%1))
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
437 call fft %+ n4 %+ %2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
438 add r0, n*2 - (n2&(-2<<%1))
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
439 call fft %+ n4 %+ %2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
440 sub r0, n*6 + (n2&(-2<<%1))
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
441 lea r1, [ff_cos_ %+ n GLOBAL]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
442 mov r2d, n4/2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
443 jmp pass%3%2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
444
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
445 %assign n n*2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
446 %endrep
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
447 %undef n
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
448
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
449 align 8
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
450 dispatch_tab%3%2: pointer list_of_fft
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
451
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
452 ; On x86_32, this function does the register saving and restoring for all of fft.
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
453 ; The others pass args in registers and don't spill anything.
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
454 cglobal ff_fft_dispatch%3%2, 2,5,0, z, nbits
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
455 lea r2, [dispatch_tab%3%2 GLOBAL]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
456 mov r2, [r2 + (nbitsq-2)*gprsize]
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
457 call r2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
458 RET
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
459 %endmacro ; DECL_FFT
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
460
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
461 DECL_FFT 5, _sse
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
462 DECL_FFT 5, _sse, _interleave
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
463 DECL_FFT 4, _3dn
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
464 DECL_FFT 4, _3dn, _interleave
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
465 DECL_FFT 4, _3dn2
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
466 DECL_FFT 4, _3dn2, _interleave
a8a8205a9081 split-radix FFT
lorenm
parents:
diff changeset
467