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