1 /*
2  * Copyright (c) 2003, 2007-14 Matteo Frigo
3  * Copyright (c) 2003, 2007-14 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 Thu Dec 10 07:05:09 EST 2020 */
23 
24 #include "dft/codelet-dft.h"
25 
26 #if defined(ARCH_PREFERS_FMA) || defined(ISA_EXTENSION_PREFERS_FMA)
27 
28 /* Generated by: ../../../genfft/gen_twiddle_c.native -fma -simd -compact -variables 4 -pipeline-latency 8 -n 10 -name t1fuv_10 -include dft/simd/t1fu.h */
29 
30 /*
31  * This function contains 51 FP additions, 40 FP multiplications,
32  * (or, 33 additions, 22 multiplications, 18 fused multiply/add),
33  * 32 stack variables, 4 constants, and 20 memory accesses
34  */
35 #include "dft/simd/t1fu.h"
36 
t1fuv_10(R * ri,R * ii,const R * W,stride rs,INT mb,INT me,INT ms)37 static void t1fuv_10(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms)
38 {
39      DVK(KP559016994, +0.559016994374947424102293417182819058860154590);
40      DVK(KP618033988, +0.618033988749894848204586834365638117720309180);
41      DVK(KP951056516, +0.951056516295153572116439333379382143405698634);
42      DVK(KP250000000, +0.250000000000000000000000000000000000000000000);
43      {
44 	  INT m;
45 	  R *x;
46 	  x = ri;
47 	  for (m = mb, W = W + (mb * ((TWVL / VL) * 18)); m < me; m = m + VL, x = x + (VL * ms), W = W + (TWVL * 18), MAKE_VOLATILE_STRIDE(10, rs)) {
48 	       V T4, TA, Tk, Tp, Tq, TE, TF, TG, T9, Te, Tf, TB, TC, TD, T1;
49 	       V T3, T2;
50 	       T1 = LD(&(x[0]), ms, &(x[0]));
51 	       T2 = LD(&(x[WS(rs, 5)]), ms, &(x[WS(rs, 1)]));
52 	       T3 = BYTWJ(&(W[TWVL * 8]), T2);
53 	       T4 = VSUB(T1, T3);
54 	       TA = VADD(T1, T3);
55 	       {
56 		    V Th, To, Tj, Tm;
57 		    {
58 			 V Tg, Tn, Ti, Tl;
59 			 Tg = LD(&(x[WS(rs, 4)]), ms, &(x[0]));
60 			 Th = BYTWJ(&(W[TWVL * 6]), Tg);
61 			 Tn = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)]));
62 			 To = BYTWJ(&(W[0]), Tn);
63 			 Ti = LD(&(x[WS(rs, 9)]), ms, &(x[WS(rs, 1)]));
64 			 Tj = BYTWJ(&(W[TWVL * 16]), Ti);
65 			 Tl = LD(&(x[WS(rs, 6)]), ms, &(x[0]));
66 			 Tm = BYTWJ(&(W[TWVL * 10]), Tl);
67 		    }
68 		    Tk = VSUB(Th, Tj);
69 		    Tp = VSUB(Tm, To);
70 		    Tq = VADD(Tk, Tp);
71 		    TE = VADD(Th, Tj);
72 		    TF = VADD(Tm, To);
73 		    TG = VADD(TE, TF);
74 	       }
75 	       {
76 		    V T6, Td, T8, Tb;
77 		    {
78 			 V T5, Tc, T7, Ta;
79 			 T5 = LD(&(x[WS(rs, 2)]), ms, &(x[0]));
80 			 T6 = BYTWJ(&(W[TWVL * 2]), T5);
81 			 Tc = LD(&(x[WS(rs, 3)]), ms, &(x[WS(rs, 1)]));
82 			 Td = BYTWJ(&(W[TWVL * 4]), Tc);
83 			 T7 = LD(&(x[WS(rs, 7)]), ms, &(x[WS(rs, 1)]));
84 			 T8 = BYTWJ(&(W[TWVL * 12]), T7);
85 			 Ta = LD(&(x[WS(rs, 8)]), ms, &(x[0]));
86 			 Tb = BYTWJ(&(W[TWVL * 14]), Ta);
87 		    }
88 		    T9 = VSUB(T6, T8);
89 		    Te = VSUB(Tb, Td);
90 		    Tf = VADD(T9, Te);
91 		    TB = VADD(T6, T8);
92 		    TC = VADD(Tb, Td);
93 		    TD = VADD(TB, TC);
94 	       }
95 	       {
96 		    V Tt, Tr, Ts, Tx, Tz, Tv, Tw, Ty, Tu;
97 		    Tt = VSUB(Tf, Tq);
98 		    Tr = VADD(Tf, Tq);
99 		    Ts = VFNMS(LDK(KP250000000), Tr, T4);
100 		    Tv = VSUB(T9, Te);
101 		    Tw = VSUB(Tk, Tp);
102 		    Tx = VMUL(LDK(KP951056516), VFMA(LDK(KP618033988), Tw, Tv));
103 		    Tz = VMUL(LDK(KP951056516), VFNMS(LDK(KP618033988), Tv, Tw));
104 		    ST(&(x[WS(rs, 5)]), VADD(T4, Tr), ms, &(x[WS(rs, 1)]));
105 		    Ty = VFNMS(LDK(KP559016994), Tt, Ts);
106 		    ST(&(x[WS(rs, 3)]), VFNMSI(Tz, Ty), ms, &(x[WS(rs, 1)]));
107 		    ST(&(x[WS(rs, 7)]), VFMAI(Tz, Ty), ms, &(x[WS(rs, 1)]));
108 		    Tu = VFMA(LDK(KP559016994), Tt, Ts);
109 		    ST(&(x[WS(rs, 1)]), VFNMSI(Tx, Tu), ms, &(x[WS(rs, 1)]));
110 		    ST(&(x[WS(rs, 9)]), VFMAI(Tx, Tu), ms, &(x[WS(rs, 1)]));
111 	       }
112 	       {
113 		    V TJ, TH, TI, TN, TP, TL, TM, TO, TK;
114 		    TJ = VSUB(TD, TG);
115 		    TH = VADD(TD, TG);
116 		    TI = VFNMS(LDK(KP250000000), TH, TA);
117 		    TL = VSUB(TE, TF);
118 		    TM = VSUB(TB, TC);
119 		    TN = VMUL(LDK(KP951056516), VFNMS(LDK(KP618033988), TM, TL));
120 		    TP = VMUL(LDK(KP951056516), VFMA(LDK(KP618033988), TL, TM));
121 		    ST(&(x[0]), VADD(TA, TH), ms, &(x[0]));
122 		    TO = VFMA(LDK(KP559016994), TJ, TI);
123 		    ST(&(x[WS(rs, 4)]), VFMAI(TP, TO), ms, &(x[0]));
124 		    ST(&(x[WS(rs, 6)]), VFNMSI(TP, TO), ms, &(x[0]));
125 		    TK = VFNMS(LDK(KP559016994), TJ, TI);
126 		    ST(&(x[WS(rs, 2)]), VFMAI(TN, TK), ms, &(x[0]));
127 		    ST(&(x[WS(rs, 8)]), VFNMSI(TN, TK), ms, &(x[0]));
128 	       }
129 	  }
130      }
131      VLEAVE();
132 }
133 
134 static const tw_instr twinstr[] = {
135      VTW(0, 1),
136      VTW(0, 2),
137      VTW(0, 3),
138      VTW(0, 4),
139      VTW(0, 5),
140      VTW(0, 6),
141      VTW(0, 7),
142      VTW(0, 8),
143      VTW(0, 9),
144      { TW_NEXT, VL, 0 }
145 };
146 
147 static const ct_desc desc = { 10, XSIMD_STRING("t1fuv_10"), twinstr, &GENUS, { 33, 22, 18, 0 }, 0, 0, 0 };
148 
XSIMD(codelet_t1fuv_10)149 void XSIMD(codelet_t1fuv_10) (planner *p) {
150      X(kdft_dit_register) (p, t1fuv_10, &desc);
151 }
152 #else
153 
154 /* Generated by: ../../../genfft/gen_twiddle_c.native -simd -compact -variables 4 -pipeline-latency 8 -n 10 -name t1fuv_10 -include dft/simd/t1fu.h */
155 
156 /*
157  * This function contains 51 FP additions, 30 FP multiplications,
158  * (or, 45 additions, 24 multiplications, 6 fused multiply/add),
159  * 32 stack variables, 4 constants, and 20 memory accesses
160  */
161 #include "dft/simd/t1fu.h"
162 
t1fuv_10(R * ri,R * ii,const R * W,stride rs,INT mb,INT me,INT ms)163 static void t1fuv_10(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms)
164 {
165      DVK(KP587785252, +0.587785252292473129168705954639072768597652438);
166      DVK(KP951056516, +0.951056516295153572116439333379382143405698634);
167      DVK(KP250000000, +0.250000000000000000000000000000000000000000000);
168      DVK(KP559016994, +0.559016994374947424102293417182819058860154590);
169      {
170 	  INT m;
171 	  R *x;
172 	  x = ri;
173 	  for (m = mb, W = W + (mb * ((TWVL / VL) * 18)); m < me; m = m + VL, x = x + (VL * ms), W = W + (TWVL * 18), MAKE_VOLATILE_STRIDE(10, rs)) {
174 	       V Tr, TH, Tg, Tl, Tm, TA, TB, TJ, T5, Ta, Tb, TD, TE, TI, To;
175 	       V Tq, Tp;
176 	       To = LD(&(x[0]), ms, &(x[0]));
177 	       Tp = LD(&(x[WS(rs, 5)]), ms, &(x[WS(rs, 1)]));
178 	       Tq = BYTWJ(&(W[TWVL * 8]), Tp);
179 	       Tr = VSUB(To, Tq);
180 	       TH = VADD(To, Tq);
181 	       {
182 		    V Td, Tk, Tf, Ti;
183 		    {
184 			 V Tc, Tj, Te, Th;
185 			 Tc = LD(&(x[WS(rs, 4)]), ms, &(x[0]));
186 			 Td = BYTWJ(&(W[TWVL * 6]), Tc);
187 			 Tj = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)]));
188 			 Tk = BYTWJ(&(W[0]), Tj);
189 			 Te = LD(&(x[WS(rs, 9)]), ms, &(x[WS(rs, 1)]));
190 			 Tf = BYTWJ(&(W[TWVL * 16]), Te);
191 			 Th = LD(&(x[WS(rs, 6)]), ms, &(x[0]));
192 			 Ti = BYTWJ(&(W[TWVL * 10]), Th);
193 		    }
194 		    Tg = VSUB(Td, Tf);
195 		    Tl = VSUB(Ti, Tk);
196 		    Tm = VADD(Tg, Tl);
197 		    TA = VADD(Td, Tf);
198 		    TB = VADD(Ti, Tk);
199 		    TJ = VADD(TA, TB);
200 	       }
201 	       {
202 		    V T2, T9, T4, T7;
203 		    {
204 			 V T1, T8, T3, T6;
205 			 T1 = LD(&(x[WS(rs, 2)]), ms, &(x[0]));
206 			 T2 = BYTWJ(&(W[TWVL * 2]), T1);
207 			 T8 = LD(&(x[WS(rs, 3)]), ms, &(x[WS(rs, 1)]));
208 			 T9 = BYTWJ(&(W[TWVL * 4]), T8);
209 			 T3 = LD(&(x[WS(rs, 7)]), ms, &(x[WS(rs, 1)]));
210 			 T4 = BYTWJ(&(W[TWVL * 12]), T3);
211 			 T6 = LD(&(x[WS(rs, 8)]), ms, &(x[0]));
212 			 T7 = BYTWJ(&(W[TWVL * 14]), T6);
213 		    }
214 		    T5 = VSUB(T2, T4);
215 		    Ta = VSUB(T7, T9);
216 		    Tb = VADD(T5, Ta);
217 		    TD = VADD(T2, T4);
218 		    TE = VADD(T7, T9);
219 		    TI = VADD(TD, TE);
220 	       }
221 	       {
222 		    V Tn, Ts, Tt, Tx, Tz, Tv, Tw, Ty, Tu;
223 		    Tn = VMUL(LDK(KP559016994), VSUB(Tb, Tm));
224 		    Ts = VADD(Tb, Tm);
225 		    Tt = VFNMS(LDK(KP250000000), Ts, Tr);
226 		    Tv = VSUB(T5, Ta);
227 		    Tw = VSUB(Tg, Tl);
228 		    Tx = VBYI(VFMA(LDK(KP951056516), Tv, VMUL(LDK(KP587785252), Tw)));
229 		    Tz = VBYI(VFNMS(LDK(KP587785252), Tv, VMUL(LDK(KP951056516), Tw)));
230 		    ST(&(x[WS(rs, 5)]), VADD(Tr, Ts), ms, &(x[WS(rs, 1)]));
231 		    Ty = VSUB(Tt, Tn);
232 		    ST(&(x[WS(rs, 3)]), VSUB(Ty, Tz), ms, &(x[WS(rs, 1)]));
233 		    ST(&(x[WS(rs, 7)]), VADD(Tz, Ty), ms, &(x[WS(rs, 1)]));
234 		    Tu = VADD(Tn, Tt);
235 		    ST(&(x[WS(rs, 1)]), VSUB(Tu, Tx), ms, &(x[WS(rs, 1)]));
236 		    ST(&(x[WS(rs, 9)]), VADD(Tx, Tu), ms, &(x[WS(rs, 1)]));
237 	       }
238 	       {
239 		    V TM, TK, TL, TG, TO, TC, TF, TP, TN;
240 		    TM = VMUL(LDK(KP559016994), VSUB(TI, TJ));
241 		    TK = VADD(TI, TJ);
242 		    TL = VFNMS(LDK(KP250000000), TK, TH);
243 		    TC = VSUB(TA, TB);
244 		    TF = VSUB(TD, TE);
245 		    TG = VBYI(VFNMS(LDK(KP587785252), TF, VMUL(LDK(KP951056516), TC)));
246 		    TO = VBYI(VFMA(LDK(KP951056516), TF, VMUL(LDK(KP587785252), TC)));
247 		    ST(&(x[0]), VADD(TH, TK), ms, &(x[0]));
248 		    TP = VADD(TM, TL);
249 		    ST(&(x[WS(rs, 4)]), VADD(TO, TP), ms, &(x[0]));
250 		    ST(&(x[WS(rs, 6)]), VSUB(TP, TO), ms, &(x[0]));
251 		    TN = VSUB(TL, TM);
252 		    ST(&(x[WS(rs, 2)]), VADD(TG, TN), ms, &(x[0]));
253 		    ST(&(x[WS(rs, 8)]), VSUB(TN, TG), ms, &(x[0]));
254 	       }
255 	  }
256      }
257      VLEAVE();
258 }
259 
260 static const tw_instr twinstr[] = {
261      VTW(0, 1),
262      VTW(0, 2),
263      VTW(0, 3),
264      VTW(0, 4),
265      VTW(0, 5),
266      VTW(0, 6),
267      VTW(0, 7),
268      VTW(0, 8),
269      VTW(0, 9),
270      { TW_NEXT, VL, 0 }
271 };
272 
273 static const ct_desc desc = { 10, XSIMD_STRING("t1fuv_10"), twinstr, &GENUS, { 45, 24, 6, 0 }, 0, 0, 0 };
274 
XSIMD(codelet_t1fuv_10)275 void XSIMD(codelet_t1fuv_10) (planner *p) {
276      X(kdft_dit_register) (p, t1fuv_10, &desc);
277 }
278 #endif
279