Mercurial > hg > sv-dependency-builds
comparison src/fftw-3.3.3/dft/scalar/codelets/t2_4.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:35:59 EST 2012 */ | |
23 | |
24 #include "codelet-dft.h" | |
25 | |
26 #ifdef HAVE_FMA | |
27 | |
28 /* Generated by: ../../../genfft/gen_twiddle.native -fma -reorder-insns -schedule-for-pipeline -compact -variables 4 -pipeline-latency 4 -twiddle-log3 -precompute-twiddles -n 4 -name t2_4 -include t.h */ | |
29 | |
30 /* | |
31 * This function contains 24 FP additions, 16 FP multiplications, | |
32 * (or, 16 additions, 8 multiplications, 8 fused multiply/add), | |
33 * 33 stack variables, 0 constants, and 16 memory accesses | |
34 */ | |
35 #include "t.h" | |
36 | |
37 static void t2_4(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms) | |
38 { | |
39 { | |
40 INT m; | |
41 for (m = mb, W = W + (mb * 4); m < me; m = m + 1, ri = ri + ms, ii = ii + ms, W = W + 4, MAKE_VOLATILE_STRIDE(8, rs)) { | |
42 E Ti, Tq, To, Te, Ty, Tz, Tm, Ts; | |
43 { | |
44 E T2, T6, T3, T5; | |
45 T2 = W[0]; | |
46 T6 = W[3]; | |
47 T3 = W[2]; | |
48 T5 = W[1]; | |
49 { | |
50 E T1, Tx, Td, Tw, Tj, Tl, Ta, T4, Tk, Tr; | |
51 T1 = ri[0]; | |
52 Ta = T2 * T6; | |
53 T4 = T2 * T3; | |
54 Tx = ii[0]; | |
55 { | |
56 E T8, Tb, T7, Tc; | |
57 T8 = ri[WS(rs, 2)]; | |
58 Tb = FNMS(T5, T3, Ta); | |
59 T7 = FMA(T5, T6, T4); | |
60 Tc = ii[WS(rs, 2)]; | |
61 { | |
62 E Tf, Th, T9, Tv, Tg, Tp; | |
63 Tf = ri[WS(rs, 1)]; | |
64 Th = ii[WS(rs, 1)]; | |
65 T9 = T7 * T8; | |
66 Tv = T7 * Tc; | |
67 Tg = T2 * Tf; | |
68 Tp = T2 * Th; | |
69 Td = FMA(Tb, Tc, T9); | |
70 Tw = FNMS(Tb, T8, Tv); | |
71 Ti = FMA(T5, Th, Tg); | |
72 Tq = FNMS(T5, Tf, Tp); | |
73 } | |
74 Tj = ri[WS(rs, 3)]; | |
75 Tl = ii[WS(rs, 3)]; | |
76 } | |
77 To = T1 - Td; | |
78 Te = T1 + Td; | |
79 Ty = Tw + Tx; | |
80 Tz = Tx - Tw; | |
81 Tk = T3 * Tj; | |
82 Tr = T3 * Tl; | |
83 Tm = FMA(T6, Tl, Tk); | |
84 Ts = FNMS(T6, Tj, Tr); | |
85 } | |
86 } | |
87 { | |
88 E Tn, TA, Tu, Tt; | |
89 Tn = Ti + Tm; | |
90 TA = Ti - Tm; | |
91 Tu = Tq + Ts; | |
92 Tt = Tq - Ts; | |
93 ii[WS(rs, 3)] = TA + Tz; | |
94 ii[WS(rs, 1)] = Tz - TA; | |
95 ri[0] = Te + Tn; | |
96 ri[WS(rs, 2)] = Te - Tn; | |
97 ri[WS(rs, 1)] = To + Tt; | |
98 ri[WS(rs, 3)] = To - Tt; | |
99 ii[WS(rs, 2)] = Ty - Tu; | |
100 ii[0] = Tu + Ty; | |
101 } | |
102 } | |
103 } | |
104 } | |
105 | |
106 static const tw_instr twinstr[] = { | |
107 {TW_CEXP, 0, 1}, | |
108 {TW_CEXP, 0, 3}, | |
109 {TW_NEXT, 1, 0} | |
110 }; | |
111 | |
112 static const ct_desc desc = { 4, "t2_4", twinstr, &GENUS, {16, 8, 8, 0}, 0, 0, 0 }; | |
113 | |
114 void X(codelet_t2_4) (planner *p) { | |
115 X(kdft_dit_register) (p, t2_4, &desc); | |
116 } | |
117 #else /* HAVE_FMA */ | |
118 | |
119 /* Generated by: ../../../genfft/gen_twiddle.native -compact -variables 4 -pipeline-latency 4 -twiddle-log3 -precompute-twiddles -n 4 -name t2_4 -include t.h */ | |
120 | |
121 /* | |
122 * This function contains 24 FP additions, 16 FP multiplications, | |
123 * (or, 16 additions, 8 multiplications, 8 fused multiply/add), | |
124 * 21 stack variables, 0 constants, and 16 memory accesses | |
125 */ | |
126 #include "t.h" | |
127 | |
128 static void t2_4(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms) | |
129 { | |
130 { | |
131 INT m; | |
132 for (m = mb, W = W + (mb * 4); m < me; m = m + 1, ri = ri + ms, ii = ii + ms, W = W + 4, MAKE_VOLATILE_STRIDE(8, rs)) { | |
133 E T2, T4, T3, T5, T6, T8; | |
134 T2 = W[0]; | |
135 T4 = W[1]; | |
136 T3 = W[2]; | |
137 T5 = W[3]; | |
138 T6 = FMA(T2, T3, T4 * T5); | |
139 T8 = FNMS(T4, T3, T2 * T5); | |
140 { | |
141 E T1, Tp, Ta, To, Te, Tk, Th, Tl, T7, T9; | |
142 T1 = ri[0]; | |
143 Tp = ii[0]; | |
144 T7 = ri[WS(rs, 2)]; | |
145 T9 = ii[WS(rs, 2)]; | |
146 Ta = FMA(T6, T7, T8 * T9); | |
147 To = FNMS(T8, T7, T6 * T9); | |
148 { | |
149 E Tc, Td, Tf, Tg; | |
150 Tc = ri[WS(rs, 1)]; | |
151 Td = ii[WS(rs, 1)]; | |
152 Te = FMA(T2, Tc, T4 * Td); | |
153 Tk = FNMS(T4, Tc, T2 * Td); | |
154 Tf = ri[WS(rs, 3)]; | |
155 Tg = ii[WS(rs, 3)]; | |
156 Th = FMA(T3, Tf, T5 * Tg); | |
157 Tl = FNMS(T5, Tf, T3 * Tg); | |
158 } | |
159 { | |
160 E Tb, Ti, Tn, Tq; | |
161 Tb = T1 + Ta; | |
162 Ti = Te + Th; | |
163 ri[WS(rs, 2)] = Tb - Ti; | |
164 ri[0] = Tb + Ti; | |
165 Tn = Tk + Tl; | |
166 Tq = To + Tp; | |
167 ii[0] = Tn + Tq; | |
168 ii[WS(rs, 2)] = Tq - Tn; | |
169 } | |
170 { | |
171 E Tj, Tm, Tr, Ts; | |
172 Tj = T1 - Ta; | |
173 Tm = Tk - Tl; | |
174 ri[WS(rs, 3)] = Tj - Tm; | |
175 ri[WS(rs, 1)] = Tj + Tm; | |
176 Tr = Tp - To; | |
177 Ts = Te - Th; | |
178 ii[WS(rs, 1)] = Tr - Ts; | |
179 ii[WS(rs, 3)] = Ts + Tr; | |
180 } | |
181 } | |
182 } | |
183 } | |
184 } | |
185 | |
186 static const tw_instr twinstr[] = { | |
187 {TW_CEXP, 0, 1}, | |
188 {TW_CEXP, 0, 3}, | |
189 {TW_NEXT, 1, 0} | |
190 }; | |
191 | |
192 static const ct_desc desc = { 4, "t2_4", twinstr, &GENUS, {16, 8, 8, 0}, 0, 0, 0 }; | |
193 | |
194 void X(codelet_t2_4) (planner *p) { | |
195 X(kdft_dit_register) (p, t2_4, &desc); | |
196 } | |
197 #endif /* HAVE_FMA */ |