Mercurial > hg > sv-dependency-builds
comparison src/fftw-3.3.3/dft/simd/common/t3fv_4.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:49 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 4 -name t3fv_4 -include t3f.h */ | |
29 | |
30 /* | |
31 * This function contains 12 FP additions, 10 FP multiplications, | |
32 * (or, 10 additions, 8 multiplications, 2 fused multiply/add), | |
33 * 16 stack variables, 0 constants, and 8 memory accesses | |
34 */ | |
35 #include "t3f.h" | |
36 | |
37 static void t3fv_4(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms) | |
38 { | |
39 { | |
40 INT m; | |
41 R *x; | |
42 x = ri; | |
43 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(4, rs)) { | |
44 V T2, T3, T1, Ta, T5, T8; | |
45 T2 = LDW(&(W[0])); | |
46 T3 = LDW(&(W[TWVL * 2])); | |
47 T1 = LD(&(x[0]), ms, &(x[0])); | |
48 Ta = LD(&(x[WS(rs, 3)]), ms, &(x[WS(rs, 1)])); | |
49 T5 = LD(&(x[WS(rs, 2)]), ms, &(x[0])); | |
50 T8 = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)])); | |
51 { | |
52 V T4, Tb, T9, T6; | |
53 T4 = VZMULJ(T2, T3); | |
54 Tb = VZMULJ(T3, Ta); | |
55 T9 = VZMULJ(T2, T8); | |
56 T6 = VZMULJ(T4, T5); | |
57 { | |
58 V Tc, Te, T7, Td; | |
59 Tc = VSUB(T9, Tb); | |
60 Te = VADD(T9, Tb); | |
61 T7 = VSUB(T1, T6); | |
62 Td = VADD(T1, T6); | |
63 ST(&(x[0]), VADD(Td, Te), ms, &(x[0])); | |
64 ST(&(x[WS(rs, 2)]), VSUB(Td, Te), ms, &(x[0])); | |
65 ST(&(x[WS(rs, 3)]), VFMAI(Tc, T7), ms, &(x[WS(rs, 1)])); | |
66 ST(&(x[WS(rs, 1)]), VFNMSI(Tc, T7), ms, &(x[WS(rs, 1)])); | |
67 } | |
68 } | |
69 } | |
70 } | |
71 VLEAVE(); | |
72 } | |
73 | |
74 static const tw_instr twinstr[] = { | |
75 VTW(0, 1), | |
76 VTW(0, 3), | |
77 {TW_NEXT, VL, 0} | |
78 }; | |
79 | |
80 static const ct_desc desc = { 4, XSIMD_STRING("t3fv_4"), twinstr, &GENUS, {10, 8, 2, 0}, 0, 0, 0 }; | |
81 | |
82 void XSIMD(codelet_t3fv_4) (planner *p) { | |
83 X(kdft_dit_register) (p, t3fv_4, &desc); | |
84 } | |
85 #else /* HAVE_FMA */ | |
86 | |
87 /* Generated by: ../../../genfft/gen_twiddle_c.native -simd -compact -variables 4 -pipeline-latency 8 -twiddle-log3 -precompute-twiddles -no-generate-bytw -n 4 -name t3fv_4 -include t3f.h */ | |
88 | |
89 /* | |
90 * This function contains 12 FP additions, 8 FP multiplications, | |
91 * (or, 12 additions, 8 multiplications, 0 fused multiply/add), | |
92 * 16 stack variables, 0 constants, and 8 memory accesses | |
93 */ | |
94 #include "t3f.h" | |
95 | |
96 static void t3fv_4(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms) | |
97 { | |
98 { | |
99 INT m; | |
100 R *x; | |
101 x = ri; | |
102 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(4, rs)) { | |
103 V T2, T3, T4; | |
104 T2 = LDW(&(W[0])); | |
105 T3 = LDW(&(W[TWVL * 2])); | |
106 T4 = VZMULJ(T2, T3); | |
107 { | |
108 V T1, Tb, T6, T9, Ta, T5, T8; | |
109 T1 = LD(&(x[0]), ms, &(x[0])); | |
110 Ta = LD(&(x[WS(rs, 3)]), ms, &(x[WS(rs, 1)])); | |
111 Tb = VZMULJ(T3, Ta); | |
112 T5 = LD(&(x[WS(rs, 2)]), ms, &(x[0])); | |
113 T6 = VZMULJ(T4, T5); | |
114 T8 = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)])); | |
115 T9 = VZMULJ(T2, T8); | |
116 { | |
117 V T7, Tc, Td, Te; | |
118 T7 = VSUB(T1, T6); | |
119 Tc = VBYI(VSUB(T9, Tb)); | |
120 ST(&(x[WS(rs, 1)]), VSUB(T7, Tc), ms, &(x[WS(rs, 1)])); | |
121 ST(&(x[WS(rs, 3)]), VADD(T7, Tc), ms, &(x[WS(rs, 1)])); | |
122 Td = VADD(T1, T6); | |
123 Te = VADD(T9, Tb); | |
124 ST(&(x[WS(rs, 2)]), VSUB(Td, Te), ms, &(x[0])); | |
125 ST(&(x[0]), VADD(Td, Te), ms, &(x[0])); | |
126 } | |
127 } | |
128 } | |
129 } | |
130 VLEAVE(); | |
131 } | |
132 | |
133 static const tw_instr twinstr[] = { | |
134 VTW(0, 1), | |
135 VTW(0, 3), | |
136 {TW_NEXT, VL, 0} | |
137 }; | |
138 | |
139 static const ct_desc desc = { 4, XSIMD_STRING("t3fv_4"), twinstr, &GENUS, {12, 8, 0, 0}, 0, 0, 0 }; | |
140 | |
141 void XSIMD(codelet_t3fv_4) (planner *p) { | |
142 X(kdft_dit_register) (p, t3fv_4, &desc); | |
143 } | |
144 #endif /* HAVE_FMA */ |