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