Mercurial > hg > sv-dependency-builds
comparison src/fftw-3.3.3/dft/simd/common/t2fv_8.c @ 10:37bf6b4a2645
Add FFTW3
author | Chris Cannam |
---|---|
date | Wed, 20 Mar 2013 15:35:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9:c0fb53affa76 | 10:37bf6b4a2645 |
---|---|
1 /* | |
2 * Copyright (c) 2003, 2007-11 Matteo Frigo | |
3 * Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology | |
4 * | |
5 * This program is free software; you can redistribute it and/or modify | |
6 * it under the terms of the GNU General Public License as published by | |
7 * the Free Software Foundation; either version 2 of the License, or | |
8 * (at your option) any later version. | |
9 * | |
10 * This program is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 * GNU General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU General Public License | |
16 * along with this program; if not, write to the Free Software | |
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
18 * | |
19 */ | |
20 | |
21 /* This file was automatically generated --- DO NOT EDIT */ | |
22 /* Generated on Sun Nov 25 07:38:35 EST 2012 */ | |
23 | |
24 #include "codelet-dft.h" | |
25 | |
26 #ifdef HAVE_FMA | |
27 | |
28 /* Generated by: ../../../genfft/gen_twiddle_c.native -fma -reorder-insns -schedule-for-pipeline -simd -compact -variables 4 -pipeline-latency 8 -n 8 -name t2fv_8 -include t2f.h */ | |
29 | |
30 /* | |
31 * This function contains 33 FP additions, 24 FP multiplications, | |
32 * (or, 23 additions, 14 multiplications, 10 fused multiply/add), | |
33 * 36 stack variables, 1 constants, and 16 memory accesses | |
34 */ | |
35 #include "t2f.h" | |
36 | |
37 static void t2fv_8(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms) | |
38 { | |
39 DVK(KP707106781, +0.707106781186547524400844362104849039284835938); | |
40 { | |
41 INT m; | |
42 R *x; | |
43 x = ri; | |
44 for (m = mb, W = W + (mb * ((TWVL / VL) * 14)); m < me; m = m + VL, x = x + (VL * ms), W = W + (TWVL * 14), MAKE_VOLATILE_STRIDE(8, rs)) { | |
45 V T1, T2, Th, Tj, T5, T7, Ta, Tc; | |
46 T1 = LD(&(x[0]), ms, &(x[0])); | |
47 T2 = LD(&(x[WS(rs, 4)]), ms, &(x[0])); | |
48 Th = LD(&(x[WS(rs, 2)]), ms, &(x[0])); | |
49 Tj = LD(&(x[WS(rs, 6)]), ms, &(x[0])); | |
50 T5 = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)])); | |
51 T7 = LD(&(x[WS(rs, 5)]), ms, &(x[WS(rs, 1)])); | |
52 Ta = LD(&(x[WS(rs, 7)]), ms, &(x[WS(rs, 1)])); | |
53 Tc = LD(&(x[WS(rs, 3)]), ms, &(x[WS(rs, 1)])); | |
54 { | |
55 V T3, Ti, Tk, T6, T8, Tb, Td; | |
56 T3 = BYTWJ(&(W[TWVL * 6]), T2); | |
57 Ti = BYTWJ(&(W[TWVL * 2]), Th); | |
58 Tk = BYTWJ(&(W[TWVL * 10]), Tj); | |
59 T6 = BYTWJ(&(W[0]), T5); | |
60 T8 = BYTWJ(&(W[TWVL * 8]), T7); | |
61 Tb = BYTWJ(&(W[TWVL * 12]), Ta); | |
62 Td = BYTWJ(&(W[TWVL * 4]), Tc); | |
63 { | |
64 V Tq, T4, Tr, Tl, Tt, T9, Tu, Te, Tw, Ts; | |
65 Tq = VADD(T1, T3); | |
66 T4 = VSUB(T1, T3); | |
67 Tr = VADD(Ti, Tk); | |
68 Tl = VSUB(Ti, Tk); | |
69 Tt = VADD(T6, T8); | |
70 T9 = VSUB(T6, T8); | |
71 Tu = VADD(Tb, Td); | |
72 Te = VSUB(Tb, Td); | |
73 Tw = VSUB(Tq, Tr); | |
74 Ts = VADD(Tq, Tr); | |
75 { | |
76 V Tx, Tv, Tm, Tf; | |
77 Tx = VSUB(Tu, Tt); | |
78 Tv = VADD(Tt, Tu); | |
79 Tm = VSUB(Te, T9); | |
80 Tf = VADD(T9, Te); | |
81 { | |
82 V Tp, Tn, To, Tg; | |
83 ST(&(x[WS(rs, 2)]), VFMAI(Tx, Tw), ms, &(x[0])); | |
84 ST(&(x[WS(rs, 6)]), VFNMSI(Tx, Tw), ms, &(x[0])); | |
85 ST(&(x[0]), VADD(Ts, Tv), ms, &(x[0])); | |
86 ST(&(x[WS(rs, 4)]), VSUB(Ts, Tv), ms, &(x[0])); | |
87 Tp = VFMA(LDK(KP707106781), Tm, Tl); | |
88 Tn = VFNMS(LDK(KP707106781), Tm, Tl); | |
89 To = VFNMS(LDK(KP707106781), Tf, T4); | |
90 Tg = VFMA(LDK(KP707106781), Tf, T4); | |
91 ST(&(x[WS(rs, 5)]), VFNMSI(Tp, To), ms, &(x[WS(rs, 1)])); | |
92 ST(&(x[WS(rs, 3)]), VFMAI(Tp, To), ms, &(x[WS(rs, 1)])); | |
93 ST(&(x[WS(rs, 7)]), VFMAI(Tn, Tg), ms, &(x[WS(rs, 1)])); | |
94 ST(&(x[WS(rs, 1)]), VFNMSI(Tn, Tg), ms, &(x[WS(rs, 1)])); | |
95 } | |
96 } | |
97 } | |
98 } | |
99 } | |
100 } | |
101 VLEAVE(); | |
102 } | |
103 | |
104 static const tw_instr twinstr[] = { | |
105 VTW(0, 1), | |
106 VTW(0, 2), | |
107 VTW(0, 3), | |
108 VTW(0, 4), | |
109 VTW(0, 5), | |
110 VTW(0, 6), | |
111 VTW(0, 7), | |
112 {TW_NEXT, VL, 0} | |
113 }; | |
114 | |
115 static const ct_desc desc = { 8, XSIMD_STRING("t2fv_8"), twinstr, &GENUS, {23, 14, 10, 0}, 0, 0, 0 }; | |
116 | |
117 void XSIMD(codelet_t2fv_8) (planner *p) { | |
118 X(kdft_dit_register) (p, t2fv_8, &desc); | |
119 } | |
120 #else /* HAVE_FMA */ | |
121 | |
122 /* Generated by: ../../../genfft/gen_twiddle_c.native -simd -compact -variables 4 -pipeline-latency 8 -n 8 -name t2fv_8 -include t2f.h */ | |
123 | |
124 /* | |
125 * This function contains 33 FP additions, 16 FP multiplications, | |
126 * (or, 33 additions, 16 multiplications, 0 fused multiply/add), | |
127 * 24 stack variables, 1 constants, and 16 memory accesses | |
128 */ | |
129 #include "t2f.h" | |
130 | |
131 static void t2fv_8(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms) | |
132 { | |
133 DVK(KP707106781, +0.707106781186547524400844362104849039284835938); | |
134 { | |
135 INT m; | |
136 R *x; | |
137 x = ri; | |
138 for (m = mb, W = W + (mb * ((TWVL / VL) * 14)); m < me; m = m + VL, x = x + (VL * ms), W = W + (TWVL * 14), MAKE_VOLATILE_STRIDE(8, rs)) { | |
139 V T4, Tq, Tm, Tr, T9, Tt, Te, Tu, T1, T3, T2; | |
140 T1 = LD(&(x[0]), ms, &(x[0])); | |
141 T2 = LD(&(x[WS(rs, 4)]), ms, &(x[0])); | |
142 T3 = BYTWJ(&(W[TWVL * 6]), T2); | |
143 T4 = VSUB(T1, T3); | |
144 Tq = VADD(T1, T3); | |
145 { | |
146 V Tj, Tl, Ti, Tk; | |
147 Ti = LD(&(x[WS(rs, 2)]), ms, &(x[0])); | |
148 Tj = BYTWJ(&(W[TWVL * 2]), Ti); | |
149 Tk = LD(&(x[WS(rs, 6)]), ms, &(x[0])); | |
150 Tl = BYTWJ(&(W[TWVL * 10]), Tk); | |
151 Tm = VSUB(Tj, Tl); | |
152 Tr = VADD(Tj, Tl); | |
153 } | |
154 { | |
155 V T6, T8, T5, T7; | |
156 T5 = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)])); | |
157 T6 = BYTWJ(&(W[0]), T5); | |
158 T7 = LD(&(x[WS(rs, 5)]), ms, &(x[WS(rs, 1)])); | |
159 T8 = BYTWJ(&(W[TWVL * 8]), T7); | |
160 T9 = VSUB(T6, T8); | |
161 Tt = VADD(T6, T8); | |
162 } | |
163 { | |
164 V Tb, Td, Ta, Tc; | |
165 Ta = LD(&(x[WS(rs, 7)]), ms, &(x[WS(rs, 1)])); | |
166 Tb = BYTWJ(&(W[TWVL * 12]), Ta); | |
167 Tc = LD(&(x[WS(rs, 3)]), ms, &(x[WS(rs, 1)])); | |
168 Td = BYTWJ(&(W[TWVL * 4]), Tc); | |
169 Te = VSUB(Tb, Td); | |
170 Tu = VADD(Tb, Td); | |
171 } | |
172 { | |
173 V Ts, Tv, Tw, Tx; | |
174 Ts = VADD(Tq, Tr); | |
175 Tv = VADD(Tt, Tu); | |
176 ST(&(x[WS(rs, 4)]), VSUB(Ts, Tv), ms, &(x[0])); | |
177 ST(&(x[0]), VADD(Ts, Tv), ms, &(x[0])); | |
178 Tw = VSUB(Tq, Tr); | |
179 Tx = VBYI(VSUB(Tu, Tt)); | |
180 ST(&(x[WS(rs, 6)]), VSUB(Tw, Tx), ms, &(x[0])); | |
181 ST(&(x[WS(rs, 2)]), VADD(Tw, Tx), ms, &(x[0])); | |
182 { | |
183 V Tg, To, Tn, Tp, Tf, Th; | |
184 Tf = VMUL(LDK(KP707106781), VADD(T9, Te)); | |
185 Tg = VADD(T4, Tf); | |
186 To = VSUB(T4, Tf); | |
187 Th = VMUL(LDK(KP707106781), VSUB(Te, T9)); | |
188 Tn = VBYI(VSUB(Th, Tm)); | |
189 Tp = VBYI(VADD(Tm, Th)); | |
190 ST(&(x[WS(rs, 7)]), VSUB(Tg, Tn), ms, &(x[WS(rs, 1)])); | |
191 ST(&(x[WS(rs, 3)]), VADD(To, Tp), ms, &(x[WS(rs, 1)])); | |
192 ST(&(x[WS(rs, 1)]), VADD(Tg, Tn), ms, &(x[WS(rs, 1)])); | |
193 ST(&(x[WS(rs, 5)]), VSUB(To, Tp), ms, &(x[WS(rs, 1)])); | |
194 } | |
195 } | |
196 } | |
197 } | |
198 VLEAVE(); | |
199 } | |
200 | |
201 static const tw_instr twinstr[] = { | |
202 VTW(0, 1), | |
203 VTW(0, 2), | |
204 VTW(0, 3), | |
205 VTW(0, 4), | |
206 VTW(0, 5), | |
207 VTW(0, 6), | |
208 VTW(0, 7), | |
209 {TW_NEXT, VL, 0} | |
210 }; | |
211 | |
212 static const ct_desc desc = { 8, XSIMD_STRING("t2fv_8"), twinstr, &GENUS, {33, 16, 0, 0}, 0, 0, 0 }; | |
213 | |
214 void XSIMD(codelet_t2fv_8) (planner *p) { | |
215 X(kdft_dit_register) (p, t2fv_8, &desc); | |
216 } | |
217 #endif /* HAVE_FMA */ |