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