comparison fft/fftw/fftw-3.3.4/rdft/scalar/r2cb/hb2_5.c @ 19:26056e866c29

Add FFTW to comparison table
author Chris Cannam
date Tue, 06 Oct 2015 13:08:39 +0100
parents
children
comparison
equal deleted inserted replaced
18:8db794ca3e0b 19:26056e866c29
1 /*
2 * Copyright (c) 2003, 2007-14 Matteo Frigo
3 * Copyright (c) 2003, 2007-14 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 Tue Mar 4 13:50:29 EST 2014 */
23
24 #include "codelet-rdft.h"
25
26 #ifdef HAVE_FMA
27
28 /* Generated by: ../../../genfft/gen_hc2hc.native -fma -reorder-insns -schedule-for-pipeline -compact -variables 4 -pipeline-latency 4 -sign 1 -twiddle-log3 -precompute-twiddles -n 5 -dif -name hb2_5 -include hb.h */
29
30 /*
31 * This function contains 44 FP additions, 40 FP multiplications,
32 * (or, 14 additions, 10 multiplications, 30 fused multiply/add),
33 * 51 stack variables, 4 constants, and 20 memory accesses
34 */
35 #include "hb.h"
36
37 static void hb2_5(R *cr, R *ci, const R *W, stride rs, INT mb, INT me, INT ms)
38 {
39 DK(KP951056516, +0.951056516295153572116439333379382143405698634);
40 DK(KP559016994, +0.559016994374947424102293417182819058860154590);
41 DK(KP250000000, +0.250000000000000000000000000000000000000000000);
42 DK(KP618033988, +0.618033988749894848204586834365638117720309180);
43 {
44 INT m;
45 for (m = mb, W = W + ((mb - 1) * 4); m < me; m = m + 1, cr = cr + ms, ci = ci - ms, W = W + 4, MAKE_VOLATILE_STRIDE(10, rs)) {
46 E T9, TB, Tz, Tm, T1, TG, TO, TJ, TC, Tn, Tg, To, Tf, Tw, TQ;
47 E T8, Tb, Th, Ta, Ti, Tp;
48 T9 = W[0];
49 TB = W[3];
50 Tz = W[2];
51 Tm = W[1];
52 {
53 E T4, Tu, T5, T6;
54 T1 = cr[0];
55 {
56 E TF, TA, T2, T3;
57 TF = T9 * TB;
58 TA = T9 * Tz;
59 T2 = cr[WS(rs, 1)];
60 T3 = ci[0];
61 TG = FMA(Tm, Tz, TF);
62 TO = FNMS(Tm, Tz, TF);
63 TJ = FMA(Tm, TB, TA);
64 TC = FNMS(Tm, TB, TA);
65 T4 = T2 + T3;
66 Tu = T2 - T3;
67 T5 = cr[WS(rs, 2)];
68 T6 = ci[WS(rs, 1)];
69 }
70 Tn = ci[WS(rs, 4)];
71 {
72 E Td, Te, T7, Tv;
73 Td = ci[WS(rs, 3)];
74 Te = cr[WS(rs, 4)];
75 T7 = T5 + T6;
76 Tv = T5 - T6;
77 Tg = ci[WS(rs, 2)];
78 To = Td - Te;
79 Tf = Td + Te;
80 Tw = FMA(KP618033988, Tv, Tu);
81 TQ = FNMS(KP618033988, Tu, Tv);
82 T8 = T4 + T7;
83 Tb = T4 - T7;
84 Th = cr[WS(rs, 3)];
85 }
86 }
87 cr[0] = T1 + T8;
88 Ta = FNMS(KP250000000, T8, T1);
89 Ti = Tg + Th;
90 Tp = Tg - Th;
91 {
92 E Tc, TK, Ts, Tq;
93 Tc = FMA(KP559016994, Tb, Ta);
94 TK = FNMS(KP559016994, Tb, Ta);
95 Ts = To - Tp;
96 Tq = To + Tp;
97 {
98 E Tj, TL, Tr, TM, TT;
99 Tj = FMA(KP618033988, Ti, Tf);
100 TL = FNMS(KP618033988, Tf, Ti);
101 ci[0] = Tn + Tq;
102 Tr = FNMS(KP250000000, Tq, Tn);
103 TM = FMA(KP951056516, TL, TK);
104 TT = FNMS(KP951056516, TL, TK);
105 {
106 E Tk, TD, Tt, TP;
107 Tk = FNMS(KP951056516, Tj, Tc);
108 TD = FMA(KP951056516, Tj, Tc);
109 Tt = FMA(KP559016994, Ts, Tr);
110 TP = FNMS(KP559016994, Ts, Tr);
111 {
112 E TW, TU, TS, TN;
113 TW = TB * TT;
114 TU = Tz * TT;
115 TS = TO * TM;
116 TN = TJ * TM;
117 {
118 E TI, TE, Ty, Tl;
119 TI = TG * TD;
120 TE = TC * TD;
121 Ty = Tm * Tk;
122 Tl = T9 * Tk;
123 {
124 E TR, TV, Tx, TH;
125 TR = FNMS(KP951056516, TQ, TP);
126 TV = FMA(KP951056516, TQ, TP);
127 Tx = FMA(KP951056516, Tw, Tt);
128 TH = FNMS(KP951056516, Tw, Tt);
129 ci[WS(rs, 3)] = FMA(Tz, TV, TW);
130 cr[WS(rs, 3)] = FNMS(TB, TV, TU);
131 ci[WS(rs, 2)] = FMA(TJ, TR, TS);
132 cr[WS(rs, 2)] = FNMS(TO, TR, TN);
133 ci[WS(rs, 4)] = FMA(TC, TH, TI);
134 cr[WS(rs, 4)] = FNMS(TG, TH, TE);
135 ci[WS(rs, 1)] = FMA(T9, Tx, Ty);
136 cr[WS(rs, 1)] = FNMS(Tm, Tx, Tl);
137 }
138 }
139 }
140 }
141 }
142 }
143 }
144 }
145 }
146
147 static const tw_instr twinstr[] = {
148 {TW_CEXP, 1, 1},
149 {TW_CEXP, 1, 3},
150 {TW_NEXT, 1, 0}
151 };
152
153 static const hc2hc_desc desc = { 5, "hb2_5", twinstr, &GENUS, {14, 10, 30, 0} };
154
155 void X(codelet_hb2_5) (planner *p) {
156 X(khc2hc_register) (p, hb2_5, &desc);
157 }
158 #else /* HAVE_FMA */
159
160 /* Generated by: ../../../genfft/gen_hc2hc.native -compact -variables 4 -pipeline-latency 4 -sign 1 -twiddle-log3 -precompute-twiddles -n 5 -dif -name hb2_5 -include hb.h */
161
162 /*
163 * This function contains 44 FP additions, 32 FP multiplications,
164 * (or, 30 additions, 18 multiplications, 14 fused multiply/add),
165 * 33 stack variables, 4 constants, and 20 memory accesses
166 */
167 #include "hb.h"
168
169 static void hb2_5(R *cr, R *ci, const R *W, stride rs, INT mb, INT me, INT ms)
170 {
171 DK(KP250000000, +0.250000000000000000000000000000000000000000000);
172 DK(KP587785252, +0.587785252292473129168705954639072768597652438);
173 DK(KP951056516, +0.951056516295153572116439333379382143405698634);
174 DK(KP559016994, +0.559016994374947424102293417182819058860154590);
175 {
176 INT m;
177 for (m = mb, W = W + ((mb - 1) * 4); m < me; m = m + 1, cr = cr + ms, ci = ci - ms, W = W + 4, MAKE_VOLATILE_STRIDE(10, rs)) {
178 E Th, Tk, Ti, Tl, Tn, TP, Tx, TN;
179 {
180 E Tj, Tw, Tm, Tv;
181 Th = W[0];
182 Tk = W[1];
183 Ti = W[2];
184 Tl = W[3];
185 Tj = Th * Ti;
186 Tw = Tk * Ti;
187 Tm = Tk * Tl;
188 Tv = Th * Tl;
189 Tn = Tj + Tm;
190 TP = Tv + Tw;
191 Tx = Tv - Tw;
192 TN = Tj - Tm;
193 }
194 {
195 E T1, Tp, TK, TA, T8, To, T9, Tt, TI, TC, Tg, TB;
196 {
197 E T4, Ty, T7, Tz;
198 T1 = cr[0];
199 {
200 E T2, T3, T5, T6;
201 T2 = cr[WS(rs, 1)];
202 T3 = ci[0];
203 T4 = T2 + T3;
204 Ty = T2 - T3;
205 T5 = cr[WS(rs, 2)];
206 T6 = ci[WS(rs, 1)];
207 T7 = T5 + T6;
208 Tz = T5 - T6;
209 }
210 Tp = KP559016994 * (T4 - T7);
211 TK = FMA(KP951056516, Ty, KP587785252 * Tz);
212 TA = FNMS(KP951056516, Tz, KP587785252 * Ty);
213 T8 = T4 + T7;
214 To = FNMS(KP250000000, T8, T1);
215 }
216 {
217 E Tc, Tr, Tf, Ts;
218 T9 = ci[WS(rs, 4)];
219 {
220 E Ta, Tb, Td, Te;
221 Ta = ci[WS(rs, 3)];
222 Tb = cr[WS(rs, 4)];
223 Tc = Ta - Tb;
224 Tr = Ta + Tb;
225 Td = ci[WS(rs, 2)];
226 Te = cr[WS(rs, 3)];
227 Tf = Td - Te;
228 Ts = Td + Te;
229 }
230 Tt = FNMS(KP951056516, Ts, KP587785252 * Tr);
231 TI = FMA(KP951056516, Tr, KP587785252 * Ts);
232 TC = KP559016994 * (Tc - Tf);
233 Tg = Tc + Tf;
234 TB = FNMS(KP250000000, Tg, T9);
235 }
236 cr[0] = T1 + T8;
237 ci[0] = T9 + Tg;
238 {
239 E Tu, TF, TE, TG, Tq, TD;
240 Tq = To - Tp;
241 Tu = Tq - Tt;
242 TF = Tq + Tt;
243 TD = TB - TC;
244 TE = TA + TD;
245 TG = TD - TA;
246 cr[WS(rs, 2)] = FNMS(Tx, TE, Tn * Tu);
247 ci[WS(rs, 2)] = FMA(Tn, TE, Tx * Tu);
248 cr[WS(rs, 3)] = FNMS(Tl, TG, Ti * TF);
249 ci[WS(rs, 3)] = FMA(Ti, TG, Tl * TF);
250 }
251 {
252 E TJ, TO, TM, TQ, TH, TL;
253 TH = Tp + To;
254 TJ = TH - TI;
255 TO = TH + TI;
256 TL = TC + TB;
257 TM = TK + TL;
258 TQ = TL - TK;
259 cr[WS(rs, 1)] = FNMS(Tk, TM, Th * TJ);
260 ci[WS(rs, 1)] = FMA(Th, TM, Tk * TJ);
261 cr[WS(rs, 4)] = FNMS(TP, TQ, TN * TO);
262 ci[WS(rs, 4)] = FMA(TN, TQ, TP * TO);
263 }
264 }
265 }
266 }
267 }
268
269 static const tw_instr twinstr[] = {
270 {TW_CEXP, 1, 1},
271 {TW_CEXP, 1, 3},
272 {TW_NEXT, 1, 0}
273 };
274
275 static const hc2hc_desc desc = { 5, "hb2_5", twinstr, &GENUS, {30, 18, 14, 0} };
276
277 void X(codelet_hb2_5) (planner *p) {
278 X(khc2hc_register) (p, hb2_5, &desc);
279 }
280 #endif /* HAVE_FMA */