Mercurial > hg > sv-dependency-builds
comparison src/fftw-3.3.8/rdft/scalar/r2cf/hf_3.c @ 167:bd3cc4d1df30
Add FFTW 3.3.8 source, and a Linux build
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Tue, 19 Nov 2019 14:52:55 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
166:cbd6d7e562c7 | 167:bd3cc4d1df30 |
---|---|
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 May 24 08:06:28 EDT 2018 */ | |
23 | |
24 #include "rdft/codelet-rdft.h" | |
25 | |
26 #if defined(ARCH_PREFERS_FMA) || defined(ISA_EXTENSION_PREFERS_FMA) | |
27 | |
28 /* Generated by: ../../../genfft/gen_hc2hc.native -fma -compact -variables 4 -pipeline-latency 4 -n 3 -dit -name hf_3 -include rdft/scalar/hf.h */ | |
29 | |
30 /* | |
31 * This function contains 16 FP additions, 14 FP multiplications, | |
32 * (or, 6 additions, 4 multiplications, 10 fused multiply/add), | |
33 * 15 stack variables, 2 constants, and 12 memory accesses | |
34 */ | |
35 #include "rdft/scalar/hf.h" | |
36 | |
37 static void hf_3(R *cr, R *ci, const R *W, stride rs, INT mb, INT me, INT ms) | |
38 { | |
39 DK(KP866025403, +0.866025403784438646763723170752936183471402627); | |
40 DK(KP500000000, +0.500000000000000000000000000000000000000000000); | |
41 { | |
42 INT m; | |
43 for (m = mb, W = W + ((mb - 1) * 4); m < me; m = m + 1, cr = cr + ms, ci = ci - ms, W = W + 4, MAKE_VOLATILE_STRIDE(6, rs)) { | |
44 E T1, Tl, T7, Th, Td, Tj; | |
45 T1 = cr[0]; | |
46 Tl = ci[0]; | |
47 { | |
48 E T3, T6, T4, Tg, T2, T5; | |
49 T3 = cr[WS(rs, 1)]; | |
50 T6 = ci[WS(rs, 1)]; | |
51 T2 = W[0]; | |
52 T4 = T2 * T3; | |
53 Tg = T2 * T6; | |
54 T5 = W[1]; | |
55 T7 = FMA(T5, T6, T4); | |
56 Th = FNMS(T5, T3, Tg); | |
57 } | |
58 { | |
59 E T9, Tc, Ta, Ti, T8, Tb; | |
60 T9 = cr[WS(rs, 2)]; | |
61 Tc = ci[WS(rs, 2)]; | |
62 T8 = W[2]; | |
63 Ta = T8 * T9; | |
64 Ti = T8 * Tc; | |
65 Tb = W[3]; | |
66 Td = FMA(Tb, Tc, Ta); | |
67 Tj = FNMS(Tb, T9, Ti); | |
68 } | |
69 { | |
70 E Tk, Te, Tf, To, Tm, Tn; | |
71 Tk = Th - Tj; | |
72 Te = T7 + Td; | |
73 Tf = FNMS(KP500000000, Te, T1); | |
74 cr[0] = T1 + Te; | |
75 ci[0] = FNMS(KP866025403, Tk, Tf); | |
76 cr[WS(rs, 1)] = FMA(KP866025403, Tk, Tf); | |
77 To = Td - T7; | |
78 Tm = Th + Tj; | |
79 Tn = FNMS(KP500000000, Tm, Tl); | |
80 cr[WS(rs, 2)] = FMS(KP866025403, To, Tn); | |
81 ci[WS(rs, 2)] = Tm + Tl; | |
82 ci[WS(rs, 1)] = FMA(KP866025403, To, Tn); | |
83 } | |
84 } | |
85 } | |
86 } | |
87 | |
88 static const tw_instr twinstr[] = { | |
89 {TW_FULL, 1, 3}, | |
90 {TW_NEXT, 1, 0} | |
91 }; | |
92 | |
93 static const hc2hc_desc desc = { 3, "hf_3", twinstr, &GENUS, {6, 4, 10, 0} }; | |
94 | |
95 void X(codelet_hf_3) (planner *p) { | |
96 X(khc2hc_register) (p, hf_3, &desc); | |
97 } | |
98 #else | |
99 | |
100 /* Generated by: ../../../genfft/gen_hc2hc.native -compact -variables 4 -pipeline-latency 4 -n 3 -dit -name hf_3 -include rdft/scalar/hf.h */ | |
101 | |
102 /* | |
103 * This function contains 16 FP additions, 12 FP multiplications, | |
104 * (or, 10 additions, 6 multiplications, 6 fused multiply/add), | |
105 * 15 stack variables, 2 constants, and 12 memory accesses | |
106 */ | |
107 #include "rdft/scalar/hf.h" | |
108 | |
109 static void hf_3(R *cr, R *ci, const R *W, stride rs, INT mb, INT me, INT ms) | |
110 { | |
111 DK(KP866025403, +0.866025403784438646763723170752936183471402627); | |
112 DK(KP500000000, +0.500000000000000000000000000000000000000000000); | |
113 { | |
114 INT m; | |
115 for (m = mb, W = W + ((mb - 1) * 4); m < me; m = m + 1, cr = cr + ms, ci = ci - ms, W = W + 4, MAKE_VOLATILE_STRIDE(6, rs)) { | |
116 E T1, Ti, T6, Te, Tb, Tf, Tc, Tj; | |
117 T1 = cr[0]; | |
118 Ti = ci[0]; | |
119 { | |
120 E T3, T5, T2, T4; | |
121 T3 = cr[WS(rs, 1)]; | |
122 T5 = ci[WS(rs, 1)]; | |
123 T2 = W[0]; | |
124 T4 = W[1]; | |
125 T6 = FMA(T2, T3, T4 * T5); | |
126 Te = FNMS(T4, T3, T2 * T5); | |
127 } | |
128 { | |
129 E T8, Ta, T7, T9; | |
130 T8 = cr[WS(rs, 2)]; | |
131 Ta = ci[WS(rs, 2)]; | |
132 T7 = W[2]; | |
133 T9 = W[3]; | |
134 Tb = FMA(T7, T8, T9 * Ta); | |
135 Tf = FNMS(T9, T8, T7 * Ta); | |
136 } | |
137 Tc = T6 + Tb; | |
138 Tj = Te + Tf; | |
139 { | |
140 E Td, Tg, Th, Tk; | |
141 cr[0] = T1 + Tc; | |
142 Td = FNMS(KP500000000, Tc, T1); | |
143 Tg = KP866025403 * (Te - Tf); | |
144 ci[0] = Td - Tg; | |
145 cr[WS(rs, 1)] = Td + Tg; | |
146 ci[WS(rs, 2)] = Tj + Ti; | |
147 Th = KP866025403 * (Tb - T6); | |
148 Tk = FNMS(KP500000000, Tj, Ti); | |
149 cr[WS(rs, 2)] = Th - Tk; | |
150 ci[WS(rs, 1)] = Th + Tk; | |
151 } | |
152 } | |
153 } | |
154 } | |
155 | |
156 static const tw_instr twinstr[] = { | |
157 {TW_FULL, 1, 3}, | |
158 {TW_NEXT, 1, 0} | |
159 }; | |
160 | |
161 static const hc2hc_desc desc = { 3, "hf_3", twinstr, &GENUS, {10, 6, 6, 0} }; | |
162 | |
163 void X(codelet_hf_3) (planner *p) { | |
164 X(khc2hc_register) (p, hf_3, &desc); | |
165 } | |
166 #endif |