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