comparison src/fftw-3.3.3/dft/simd/common/t1bv_6.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:03 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 6 -name t1bv_6 -include t1b.h -sign 1 */
29
30 /*
31 * This function contains 23 FP additions, 18 FP multiplications,
32 * (or, 17 additions, 12 multiplications, 6 fused multiply/add),
33 * 27 stack variables, 2 constants, and 12 memory accesses
34 */
35 #include "t1b.h"
36
37 static void t1bv_6(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms)
38 {
39 DVK(KP500000000, +0.500000000000000000000000000000000000000000000);
40 DVK(KP866025403, +0.866025403784438646763723170752936183471402627);
41 {
42 INT m;
43 R *x;
44 x = ii;
45 for (m = mb, W = W + (mb * ((TWVL / VL) * 10)); m < me; m = m + VL, x = x + (VL * ms), W = W + (TWVL * 10), MAKE_VOLATILE_STRIDE(6, rs)) {
46 V T1, T2, Ta, Tc, T5, T7;
47 T1 = LD(&(x[0]), ms, &(x[0]));
48 T2 = LD(&(x[WS(rs, 3)]), ms, &(x[WS(rs, 1)]));
49 Ta = LD(&(x[WS(rs, 4)]), ms, &(x[0]));
50 Tc = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)]));
51 T5 = LD(&(x[WS(rs, 2)]), ms, &(x[0]));
52 T7 = LD(&(x[WS(rs, 5)]), ms, &(x[WS(rs, 1)]));
53 {
54 V T3, Tb, Td, T6, T8;
55 T3 = BYTW(&(W[TWVL * 4]), T2);
56 Tb = BYTW(&(W[TWVL * 6]), Ta);
57 Td = BYTW(&(W[0]), Tc);
58 T6 = BYTW(&(W[TWVL * 2]), T5);
59 T8 = BYTW(&(W[TWVL * 8]), T7);
60 {
61 V Ti, T4, Tk, Te, Tj, T9;
62 Ti = VADD(T1, T3);
63 T4 = VSUB(T1, T3);
64 Tk = VADD(Tb, Td);
65 Te = VSUB(Tb, Td);
66 Tj = VADD(T6, T8);
67 T9 = VSUB(T6, T8);
68 {
69 V Tl, Tn, Tf, Th, Tm, Tg;
70 Tl = VADD(Tj, Tk);
71 Tn = VMUL(LDK(KP866025403), VSUB(Tj, Tk));
72 Tf = VADD(T9, Te);
73 Th = VMUL(LDK(KP866025403), VSUB(T9, Te));
74 ST(&(x[0]), VADD(Ti, Tl), ms, &(x[0]));
75 Tm = VFNMS(LDK(KP500000000), Tl, Ti);
76 ST(&(x[WS(rs, 3)]), VADD(T4, Tf), ms, &(x[WS(rs, 1)]));
77 Tg = VFNMS(LDK(KP500000000), Tf, T4);
78 ST(&(x[WS(rs, 4)]), VFMAI(Tn, Tm), ms, &(x[0]));
79 ST(&(x[WS(rs, 2)]), VFNMSI(Tn, Tm), ms, &(x[0]));
80 ST(&(x[WS(rs, 5)]), VFNMSI(Th, Tg), ms, &(x[WS(rs, 1)]));
81 ST(&(x[WS(rs, 1)]), VFMAI(Th, Tg), ms, &(x[WS(rs, 1)]));
82 }
83 }
84 }
85 }
86 }
87 VLEAVE();
88 }
89
90 static const tw_instr twinstr[] = {
91 VTW(0, 1),
92 VTW(0, 2),
93 VTW(0, 3),
94 VTW(0, 4),
95 VTW(0, 5),
96 {TW_NEXT, VL, 0}
97 };
98
99 static const ct_desc desc = { 6, XSIMD_STRING("t1bv_6"), twinstr, &GENUS, {17, 12, 6, 0}, 0, 0, 0 };
100
101 void XSIMD(codelet_t1bv_6) (planner *p) {
102 X(kdft_dit_register) (p, t1bv_6, &desc);
103 }
104 #else /* HAVE_FMA */
105
106 /* Generated by: ../../../genfft/gen_twiddle_c.native -simd -compact -variables 4 -pipeline-latency 8 -n 6 -name t1bv_6 -include t1b.h -sign 1 */
107
108 /*
109 * This function contains 23 FP additions, 14 FP multiplications,
110 * (or, 21 additions, 12 multiplications, 2 fused multiply/add),
111 * 19 stack variables, 2 constants, and 12 memory accesses
112 */
113 #include "t1b.h"
114
115 static void t1bv_6(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms)
116 {
117 DVK(KP500000000, +0.500000000000000000000000000000000000000000000);
118 DVK(KP866025403, +0.866025403784438646763723170752936183471402627);
119 {
120 INT m;
121 R *x;
122 x = ii;
123 for (m = mb, W = W + (mb * ((TWVL / VL) * 10)); m < me; m = m + VL, x = x + (VL * ms), W = W + (TWVL * 10), MAKE_VOLATILE_STRIDE(6, rs)) {
124 V Tf, Ti, Ta, Tk, T5, Tj, Tc, Te, Td;
125 Tc = LD(&(x[0]), ms, &(x[0]));
126 Td = LD(&(x[WS(rs, 3)]), ms, &(x[WS(rs, 1)]));
127 Te = BYTW(&(W[TWVL * 4]), Td);
128 Tf = VSUB(Tc, Te);
129 Ti = VADD(Tc, Te);
130 {
131 V T7, T9, T6, T8;
132 T6 = LD(&(x[WS(rs, 4)]), ms, &(x[0]));
133 T7 = BYTW(&(W[TWVL * 6]), T6);
134 T8 = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)]));
135 T9 = BYTW(&(W[0]), T8);
136 Ta = VSUB(T7, T9);
137 Tk = VADD(T7, T9);
138 }
139 {
140 V T2, T4, T1, T3;
141 T1 = LD(&(x[WS(rs, 2)]), ms, &(x[0]));
142 T2 = BYTW(&(W[TWVL * 2]), T1);
143 T3 = LD(&(x[WS(rs, 5)]), ms, &(x[WS(rs, 1)]));
144 T4 = BYTW(&(W[TWVL * 8]), T3);
145 T5 = VSUB(T2, T4);
146 Tj = VADD(T2, T4);
147 }
148 {
149 V Tb, Tg, Th, Tn, Tl, Tm;
150 Tb = VBYI(VMUL(LDK(KP866025403), VSUB(T5, Ta)));
151 Tg = VADD(T5, Ta);
152 Th = VFNMS(LDK(KP500000000), Tg, Tf);
153 ST(&(x[WS(rs, 1)]), VADD(Tb, Th), ms, &(x[WS(rs, 1)]));
154 ST(&(x[WS(rs, 3)]), VADD(Tf, Tg), ms, &(x[WS(rs, 1)]));
155 ST(&(x[WS(rs, 5)]), VSUB(Th, Tb), ms, &(x[WS(rs, 1)]));
156 Tn = VBYI(VMUL(LDK(KP866025403), VSUB(Tj, Tk)));
157 Tl = VADD(Tj, Tk);
158 Tm = VFNMS(LDK(KP500000000), Tl, Ti);
159 ST(&(x[WS(rs, 2)]), VSUB(Tm, Tn), ms, &(x[0]));
160 ST(&(x[0]), VADD(Ti, Tl), ms, &(x[0]));
161 ST(&(x[WS(rs, 4)]), VADD(Tn, Tm), ms, &(x[0]));
162 }
163 }
164 }
165 VLEAVE();
166 }
167
168 static const tw_instr twinstr[] = {
169 VTW(0, 1),
170 VTW(0, 2),
171 VTW(0, 3),
172 VTW(0, 4),
173 VTW(0, 5),
174 {TW_NEXT, VL, 0}
175 };
176
177 static const ct_desc desc = { 6, XSIMD_STRING("t1bv_6"), twinstr, &GENUS, {21, 12, 2, 0}, 0, 0, 0 };
178
179 void XSIMD(codelet_t1bv_6) (planner *p) {
180 X(kdft_dit_register) (p, t1bv_6, &desc);
181 }
182 #endif /* HAVE_FMA */