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