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:04:56 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_notw_c.native -fma -simd -compact -variables 4 -pipeline-latency 8 -sign 1 -n 4 -name n2bv_4 -with-ostride 2 -include dft/simd/n2b.h -store-multiple 2 */
29 
30 /*
31  * This function contains 8 FP additions, 2 FP multiplications,
32  * (or, 6 additions, 0 multiplications, 2 fused multiply/add),
33  * 11 stack variables, 0 constants, and 10 memory accesses
34  */
35 #include "dft/simd/n2b.h"
36 
n2bv_4(const R * ri,const R * ii,R * ro,R * io,stride is,stride os,INT v,INT ivs,INT ovs)37 static void n2bv_4(const R *ri, const R *ii, R *ro, R *io, stride is, stride os, INT v, INT ivs, INT ovs)
38 {
39      {
40 	  INT i;
41 	  const R *xi;
42 	  R *xo;
43 	  xi = ii;
44 	  xo = io;
45 	  for (i = v; i > 0; i = i - VL, xi = xi + (VL * ivs), xo = xo + (VL * ovs), MAKE_VOLATILE_STRIDE(8, is), MAKE_VOLATILE_STRIDE(8, os)) {
46 	       V T3, T7, T6, T8;
47 	       {
48 		    V T1, T2, T4, T5;
49 		    T1 = LD(&(xi[0]), ivs, &(xi[0]));
50 		    T2 = LD(&(xi[WS(is, 2)]), ivs, &(xi[0]));
51 		    T3 = VSUB(T1, T2);
52 		    T7 = VADD(T1, T2);
53 		    T4 = LD(&(xi[WS(is, 1)]), ivs, &(xi[WS(is, 1)]));
54 		    T5 = LD(&(xi[WS(is, 3)]), ivs, &(xi[WS(is, 1)]));
55 		    T6 = VSUB(T4, T5);
56 		    T8 = VADD(T4, T5);
57 	       }
58 	       {
59 		    V T9, Ta, Tb, Tc;
60 		    T9 = VFNMSI(T6, T3);
61 		    STM2(&(xo[6]), T9, ovs, &(xo[2]));
62 		    Ta = VADD(T7, T8);
63 		    STM2(&(xo[0]), Ta, ovs, &(xo[0]));
64 		    Tb = VFMAI(T6, T3);
65 		    STM2(&(xo[2]), Tb, ovs, &(xo[2]));
66 		    STN2(&(xo[0]), Ta, Tb, ovs);
67 		    Tc = VSUB(T7, T8);
68 		    STM2(&(xo[4]), Tc, ovs, &(xo[0]));
69 		    STN2(&(xo[4]), Tc, T9, ovs);
70 	       }
71 	  }
72      }
73      VLEAVE();
74 }
75 
76 static const kdft_desc desc = { 4, XSIMD_STRING("n2bv_4"), { 6, 0, 2, 0 }, &GENUS, 0, 2, 0, 0 };
77 
XSIMD(codelet_n2bv_4)78 void XSIMD(codelet_n2bv_4) (planner *p) { X(kdft_register) (p, n2bv_4, &desc);
79 }
80 
81 #else
82 
83 /* Generated by: ../../../genfft/gen_notw_c.native -simd -compact -variables 4 -pipeline-latency 8 -sign 1 -n 4 -name n2bv_4 -with-ostride 2 -include dft/simd/n2b.h -store-multiple 2 */
84 
85 /*
86  * This function contains 8 FP additions, 0 FP multiplications,
87  * (or, 8 additions, 0 multiplications, 0 fused multiply/add),
88  * 11 stack variables, 0 constants, and 10 memory accesses
89  */
90 #include "dft/simd/n2b.h"
91 
n2bv_4(const R * ri,const R * ii,R * ro,R * io,stride is,stride os,INT v,INT ivs,INT ovs)92 static void n2bv_4(const R *ri, const R *ii, R *ro, R *io, stride is, stride os, INT v, INT ivs, INT ovs)
93 {
94      {
95 	  INT i;
96 	  const R *xi;
97 	  R *xo;
98 	  xi = ii;
99 	  xo = io;
100 	  for (i = v; i > 0; i = i - VL, xi = xi + (VL * ivs), xo = xo + (VL * ovs), MAKE_VOLATILE_STRIDE(8, is), MAKE_VOLATILE_STRIDE(8, os)) {
101 	       V T3, T7, T6, T8;
102 	       {
103 		    V T1, T2, T4, T5;
104 		    T1 = LD(&(xi[0]), ivs, &(xi[0]));
105 		    T2 = LD(&(xi[WS(is, 2)]), ivs, &(xi[0]));
106 		    T3 = VSUB(T1, T2);
107 		    T7 = VADD(T1, T2);
108 		    T4 = LD(&(xi[WS(is, 1)]), ivs, &(xi[WS(is, 1)]));
109 		    T5 = LD(&(xi[WS(is, 3)]), ivs, &(xi[WS(is, 1)]));
110 		    T6 = VBYI(VSUB(T4, T5));
111 		    T8 = VADD(T4, T5);
112 	       }
113 	       {
114 		    V T9, Ta, Tb, Tc;
115 		    T9 = VSUB(T3, T6);
116 		    STM2(&(xo[6]), T9, ovs, &(xo[2]));
117 		    Ta = VADD(T7, T8);
118 		    STM2(&(xo[0]), Ta, ovs, &(xo[0]));
119 		    Tb = VADD(T3, T6);
120 		    STM2(&(xo[2]), Tb, ovs, &(xo[2]));
121 		    STN2(&(xo[0]), Ta, Tb, ovs);
122 		    Tc = VSUB(T7, T8);
123 		    STM2(&(xo[4]), Tc, ovs, &(xo[0]));
124 		    STN2(&(xo[4]), Tc, T9, ovs);
125 	       }
126 	  }
127      }
128      VLEAVE();
129 }
130 
131 static const kdft_desc desc = { 4, XSIMD_STRING("n2bv_4"), { 8, 0, 0, 0 }, &GENUS, 0, 2, 0, 0 };
132 
XSIMD(codelet_n2bv_4)133 void XSIMD(codelet_n2bv_4) (planner *p) { X(kdft_register) (p, n2bv_4, &desc);
134 }
135 
136 #endif
137