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