comparison src/fftw-3.3.3/dft/scalar/codelets/t1_3.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:47 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 -n 3 -name t1_3 -include t.h */
29
30 /*
31 * This function contains 16 FP additions, 14 FP multiplications,
32 * (or, 6 additions, 4 multiplications, 10 fused multiply/add),
33 * 21 stack variables, 2 constants, and 12 memory accesses
34 */
35 #include "t.h"
36
37 static void t1_3(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms)
38 {
39 DK(KP866025403, +0.866025403784438646763723170752936183471402627);
40 DK(KP500000000, +0.500000000000000000000000000000000000000000000);
41 {
42 INT m;
43 for (m = mb, W = W + (mb * 4); m < me; m = m + 1, ri = ri + ms, ii = ii + ms, W = W + 4, MAKE_VOLATILE_STRIDE(6, rs)) {
44 E T1, Tm, T9, Tc, Tb, Th, T7, Ti, Ta, Tj, Td;
45 T1 = ri[0];
46 Tm = ii[0];
47 {
48 E T3, T6, T2, T5, Tg, T4, T8;
49 T3 = ri[WS(rs, 1)];
50 T6 = ii[WS(rs, 1)];
51 T2 = W[0];
52 T5 = W[1];
53 T9 = ri[WS(rs, 2)];
54 Tc = ii[WS(rs, 2)];
55 Tg = T2 * T6;
56 T4 = T2 * T3;
57 T8 = W[2];
58 Tb = W[3];
59 Th = FNMS(T5, T3, Tg);
60 T7 = FMA(T5, T6, T4);
61 Ti = T8 * Tc;
62 Ta = T8 * T9;
63 }
64 Tj = FNMS(Tb, T9, Ti);
65 Td = FMA(Tb, Tc, Ta);
66 {
67 E Tk, Te, To, Tn, Tl, Tf;
68 Tk = Th - Tj;
69 Tl = Th + Tj;
70 Te = T7 + Td;
71 To = Td - T7;
72 ii[0] = Tl + Tm;
73 Tn = FNMS(KP500000000, Tl, Tm);
74 ri[0] = T1 + Te;
75 Tf = FNMS(KP500000000, Te, T1);
76 ii[WS(rs, 1)] = FMA(KP866025403, To, Tn);
77 ii[WS(rs, 2)] = FNMS(KP866025403, To, Tn);
78 ri[WS(rs, 2)] = FNMS(KP866025403, Tk, Tf);
79 ri[WS(rs, 1)] = FMA(KP866025403, Tk, Tf);
80 }
81 }
82 }
83 }
84
85 static const tw_instr twinstr[] = {
86 {TW_FULL, 0, 3},
87 {TW_NEXT, 1, 0}
88 };
89
90 static const ct_desc desc = { 3, "t1_3", twinstr, &GENUS, {6, 4, 10, 0}, 0, 0, 0 };
91
92 void X(codelet_t1_3) (planner *p) {
93 X(kdft_dit_register) (p, t1_3, &desc);
94 }
95 #else /* HAVE_FMA */
96
97 /* Generated by: ../../../genfft/gen_twiddle.native -compact -variables 4 -pipeline-latency 4 -n 3 -name t1_3 -include t.h */
98
99 /*
100 * This function contains 16 FP additions, 12 FP multiplications,
101 * (or, 10 additions, 6 multiplications, 6 fused multiply/add),
102 * 15 stack variables, 2 constants, and 12 memory accesses
103 */
104 #include "t.h"
105
106 static void t1_3(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms)
107 {
108 DK(KP866025403, +0.866025403784438646763723170752936183471402627);
109 DK(KP500000000, +0.500000000000000000000000000000000000000000000);
110 {
111 INT m;
112 for (m = mb, W = W + (mb * 4); m < me; m = m + 1, ri = ri + ms, ii = ii + ms, W = W + 4, MAKE_VOLATILE_STRIDE(6, rs)) {
113 E T1, Ti, T6, Te, Tb, Tf, Tc, Th;
114 T1 = ri[0];
115 Ti = ii[0];
116 {
117 E T3, T5, T2, T4;
118 T3 = ri[WS(rs, 1)];
119 T5 = ii[WS(rs, 1)];
120 T2 = W[0];
121 T4 = W[1];
122 T6 = FMA(T2, T3, T4 * T5);
123 Te = FNMS(T4, T3, T2 * T5);
124 }
125 {
126 E T8, Ta, T7, T9;
127 T8 = ri[WS(rs, 2)];
128 Ta = ii[WS(rs, 2)];
129 T7 = W[2];
130 T9 = W[3];
131 Tb = FMA(T7, T8, T9 * Ta);
132 Tf = FNMS(T9, T8, T7 * Ta);
133 }
134 Tc = T6 + Tb;
135 Th = Te + Tf;
136 ri[0] = T1 + Tc;
137 ii[0] = Th + Ti;
138 {
139 E Td, Tg, Tj, Tk;
140 Td = FNMS(KP500000000, Tc, T1);
141 Tg = KP866025403 * (Te - Tf);
142 ri[WS(rs, 2)] = Td - Tg;
143 ri[WS(rs, 1)] = Td + Tg;
144 Tj = KP866025403 * (Tb - T6);
145 Tk = FNMS(KP500000000, Th, Ti);
146 ii[WS(rs, 1)] = Tj + Tk;
147 ii[WS(rs, 2)] = Tk - Tj;
148 }
149 }
150 }
151 }
152
153 static const tw_instr twinstr[] = {
154 {TW_FULL, 0, 3},
155 {TW_NEXT, 1, 0}
156 };
157
158 static const ct_desc desc = { 3, "t1_3", twinstr, &GENUS, {10, 6, 6, 0}, 0, 0, 0 };
159
160 void X(codelet_t1_3) (planner *p) {
161 X(kdft_dit_register) (p, t1_3, &desc);
162 }
163 #endif /* HAVE_FMA */