comparison src/fftw-3.3.3/dft/simd/common/t2bv_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:39:09 EST 2012 */
23
24 #include "codelet-dft.h"
25
26 #ifdef HAVE_FMA
27
28 /* Generated by: ../../../genfft/gen_twiddle_c.native -fma -reorder-insns -schedule-for-pipeline -simd -compact -variables 4 -pipeline-latency 8 -n 8 -name t2bv_8 -include t2b.h -sign 1 */
29
30 /*
31 * This function contains 33 FP additions, 24 FP multiplications,
32 * (or, 23 additions, 14 multiplications, 10 fused multiply/add),
33 * 36 stack variables, 1 constants, and 16 memory accesses
34 */
35 #include "t2b.h"
36
37 static void t2bv_8(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms)
38 {
39 DVK(KP707106781, +0.707106781186547524400844362104849039284835938);
40 {
41 INT m;
42 R *x;
43 x = ii;
44 for (m = mb, W = W + (mb * ((TWVL / VL) * 14)); m < me; m = m + VL, x = x + (VL * ms), W = W + (TWVL * 14), MAKE_VOLATILE_STRIDE(8, rs)) {
45 V T1, T2, Th, Tj, T5, T7, Ta, Tc;
46 T1 = LD(&(x[0]), ms, &(x[0]));
47 T2 = LD(&(x[WS(rs, 4)]), ms, &(x[0]));
48 Th = LD(&(x[WS(rs, 2)]), ms, &(x[0]));
49 Tj = LD(&(x[WS(rs, 6)]), ms, &(x[0]));
50 T5 = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)]));
51 T7 = LD(&(x[WS(rs, 5)]), ms, &(x[WS(rs, 1)]));
52 Ta = LD(&(x[WS(rs, 7)]), ms, &(x[WS(rs, 1)]));
53 Tc = LD(&(x[WS(rs, 3)]), ms, &(x[WS(rs, 1)]));
54 {
55 V T3, Ti, Tk, T6, T8, Tb, Td;
56 T3 = BYTW(&(W[TWVL * 6]), T2);
57 Ti = BYTW(&(W[TWVL * 2]), Th);
58 Tk = BYTW(&(W[TWVL * 10]), Tj);
59 T6 = BYTW(&(W[0]), T5);
60 T8 = BYTW(&(W[TWVL * 8]), T7);
61 Tb = BYTW(&(W[TWVL * 12]), Ta);
62 Td = BYTW(&(W[TWVL * 4]), Tc);
63 {
64 V Tq, T4, Tr, Tl, Tt, T9, Tu, Te, Tw, Ts;
65 Tq = VADD(T1, T3);
66 T4 = VSUB(T1, T3);
67 Tr = VADD(Ti, Tk);
68 Tl = VSUB(Ti, Tk);
69 Tt = VADD(T6, T8);
70 T9 = VSUB(T6, T8);
71 Tu = VADD(Tb, Td);
72 Te = VSUB(Tb, Td);
73 Tw = VADD(Tq, Tr);
74 Ts = VSUB(Tq, Tr);
75 {
76 V Tx, Tv, Tm, Tf;
77 Tx = VADD(Tt, Tu);
78 Tv = VSUB(Tt, Tu);
79 Tm = VSUB(T9, Te);
80 Tf = VADD(T9, Te);
81 {
82 V Tp, Tn, To, Tg;
83 ST(&(x[0]), VADD(Tw, Tx), ms, &(x[0]));
84 ST(&(x[WS(rs, 4)]), VSUB(Tw, Tx), ms, &(x[0]));
85 ST(&(x[WS(rs, 2)]), VFMAI(Tv, Ts), ms, &(x[0]));
86 ST(&(x[WS(rs, 6)]), VFNMSI(Tv, Ts), ms, &(x[0]));
87 Tp = VFMA(LDK(KP707106781), Tm, Tl);
88 Tn = VFNMS(LDK(KP707106781), Tm, Tl);
89 To = VFMA(LDK(KP707106781), Tf, T4);
90 Tg = VFNMS(LDK(KP707106781), Tf, T4);
91 ST(&(x[WS(rs, 1)]), VFMAI(Tp, To), ms, &(x[WS(rs, 1)]));
92 ST(&(x[WS(rs, 7)]), VFNMSI(Tp, To), ms, &(x[WS(rs, 1)]));
93 ST(&(x[WS(rs, 5)]), VFMAI(Tn, Tg), ms, &(x[WS(rs, 1)]));
94 ST(&(x[WS(rs, 3)]), VFNMSI(Tn, Tg), ms, &(x[WS(rs, 1)]));
95 }
96 }
97 }
98 }
99 }
100 }
101 VLEAVE();
102 }
103
104 static const tw_instr twinstr[] = {
105 VTW(0, 1),
106 VTW(0, 2),
107 VTW(0, 3),
108 VTW(0, 4),
109 VTW(0, 5),
110 VTW(0, 6),
111 VTW(0, 7),
112 {TW_NEXT, VL, 0}
113 };
114
115 static const ct_desc desc = { 8, XSIMD_STRING("t2bv_8"), twinstr, &GENUS, {23, 14, 10, 0}, 0, 0, 0 };
116
117 void XSIMD(codelet_t2bv_8) (planner *p) {
118 X(kdft_dit_register) (p, t2bv_8, &desc);
119 }
120 #else /* HAVE_FMA */
121
122 /* Generated by: ../../../genfft/gen_twiddle_c.native -simd -compact -variables 4 -pipeline-latency 8 -n 8 -name t2bv_8 -include t2b.h -sign 1 */
123
124 /*
125 * This function contains 33 FP additions, 16 FP multiplications,
126 * (or, 33 additions, 16 multiplications, 0 fused multiply/add),
127 * 24 stack variables, 1 constants, and 16 memory accesses
128 */
129 #include "t2b.h"
130
131 static void t2bv_8(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms)
132 {
133 DVK(KP707106781, +0.707106781186547524400844362104849039284835938);
134 {
135 INT m;
136 R *x;
137 x = ii;
138 for (m = mb, W = W + (mb * ((TWVL / VL) * 14)); m < me; m = m + VL, x = x + (VL * ms), W = W + (TWVL * 14), MAKE_VOLATILE_STRIDE(8, rs)) {
139 V Tl, Tq, Tg, Tr, T5, Tt, Ta, Tu, Ti, Tk, Tj;
140 Ti = LD(&(x[0]), ms, &(x[0]));
141 Tj = LD(&(x[WS(rs, 4)]), ms, &(x[0]));
142 Tk = BYTW(&(W[TWVL * 6]), Tj);
143 Tl = VSUB(Ti, Tk);
144 Tq = VADD(Ti, Tk);
145 {
146 V Td, Tf, Tc, Te;
147 Tc = LD(&(x[WS(rs, 2)]), ms, &(x[0]));
148 Td = BYTW(&(W[TWVL * 2]), Tc);
149 Te = LD(&(x[WS(rs, 6)]), ms, &(x[0]));
150 Tf = BYTW(&(W[TWVL * 10]), Te);
151 Tg = VSUB(Td, Tf);
152 Tr = VADD(Td, Tf);
153 }
154 {
155 V T2, T4, T1, T3;
156 T1 = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)]));
157 T2 = BYTW(&(W[0]), T1);
158 T3 = LD(&(x[WS(rs, 5)]), ms, &(x[WS(rs, 1)]));
159 T4 = BYTW(&(W[TWVL * 8]), T3);
160 T5 = VSUB(T2, T4);
161 Tt = VADD(T2, T4);
162 }
163 {
164 V T7, T9, T6, T8;
165 T6 = LD(&(x[WS(rs, 7)]), ms, &(x[WS(rs, 1)]));
166 T7 = BYTW(&(W[TWVL * 12]), T6);
167 T8 = LD(&(x[WS(rs, 3)]), ms, &(x[WS(rs, 1)]));
168 T9 = BYTW(&(W[TWVL * 4]), T8);
169 Ta = VSUB(T7, T9);
170 Tu = VADD(T7, T9);
171 }
172 {
173 V Ts, Tv, Tw, Tx;
174 Ts = VSUB(Tq, Tr);
175 Tv = VBYI(VSUB(Tt, Tu));
176 ST(&(x[WS(rs, 6)]), VSUB(Ts, Tv), ms, &(x[0]));
177 ST(&(x[WS(rs, 2)]), VADD(Ts, Tv), ms, &(x[0]));
178 Tw = VADD(Tq, Tr);
179 Tx = VADD(Tt, Tu);
180 ST(&(x[WS(rs, 4)]), VSUB(Tw, Tx), ms, &(x[0]));
181 ST(&(x[0]), VADD(Tw, Tx), ms, &(x[0]));
182 {
183 V Th, To, Tn, Tp, Tb, Tm;
184 Tb = VMUL(LDK(KP707106781), VSUB(T5, Ta));
185 Th = VBYI(VSUB(Tb, Tg));
186 To = VBYI(VADD(Tg, Tb));
187 Tm = VMUL(LDK(KP707106781), VADD(T5, Ta));
188 Tn = VSUB(Tl, Tm);
189 Tp = VADD(Tl, Tm);
190 ST(&(x[WS(rs, 3)]), VADD(Th, Tn), ms, &(x[WS(rs, 1)]));
191 ST(&(x[WS(rs, 7)]), VSUB(Tp, To), ms, &(x[WS(rs, 1)]));
192 ST(&(x[WS(rs, 5)]), VSUB(Tn, Th), ms, &(x[WS(rs, 1)]));
193 ST(&(x[WS(rs, 1)]), VADD(To, Tp), ms, &(x[WS(rs, 1)]));
194 }
195 }
196 }
197 }
198 VLEAVE();
199 }
200
201 static const tw_instr twinstr[] = {
202 VTW(0, 1),
203 VTW(0, 2),
204 VTW(0, 3),
205 VTW(0, 4),
206 VTW(0, 5),
207 VTW(0, 6),
208 VTW(0, 7),
209 {TW_NEXT, VL, 0}
210 };
211
212 static const ct_desc desc = { 8, XSIMD_STRING("t2bv_8"), twinstr, &GENUS, {33, 16, 0, 0}, 0, 0, 0 };
213
214 void XSIMD(codelet_t2bv_8) (planner *p) {
215 X(kdft_dit_register) (p, t2bv_8, &desc);
216 }
217 #endif /* HAVE_FMA */