/src/fftw3/rdft/scalar/r2cf/hf_3.c
Line | Count | Source (jump to first uncovered line) |
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 Sun Jun 22 06:43:32 UTC 2025 */ |
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 | 0 | { |
111 | 0 | DK(KP866025403, +0.866025403784438646763723170752936183471402627); |
112 | 0 | DK(KP500000000, +0.500000000000000000000000000000000000000000000); |
113 | 0 | { |
114 | 0 | INT m; |
115 | 0 | 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 | 0 | E T1, Ti, T6, Te, Tb, Tf, Tc, Tj; |
117 | 0 | T1 = cr[0]; |
118 | 0 | Ti = ci[0]; |
119 | 0 | { |
120 | 0 | E T3, T5, T2, T4; |
121 | 0 | T3 = cr[WS(rs, 1)]; |
122 | 0 | T5 = ci[WS(rs, 1)]; |
123 | 0 | T2 = W[0]; |
124 | 0 | T4 = W[1]; |
125 | 0 | T6 = FMA(T2, T3, T4 * T5); |
126 | 0 | Te = FNMS(T4, T3, T2 * T5); |
127 | 0 | } |
128 | 0 | { |
129 | 0 | E T8, Ta, T7, T9; |
130 | 0 | T8 = cr[WS(rs, 2)]; |
131 | 0 | Ta = ci[WS(rs, 2)]; |
132 | 0 | T7 = W[2]; |
133 | 0 | T9 = W[3]; |
134 | 0 | Tb = FMA(T7, T8, T9 * Ta); |
135 | 0 | Tf = FNMS(T9, T8, T7 * Ta); |
136 | 0 | } |
137 | 0 | Tc = T6 + Tb; |
138 | 0 | Tj = Te + Tf; |
139 | 0 | { |
140 | 0 | E Td, Tg, Th, Tk; |
141 | 0 | cr[0] = T1 + Tc; |
142 | 0 | Td = FNMS(KP500000000, Tc, T1); |
143 | 0 | Tg = KP866025403 * (Te - Tf); |
144 | 0 | ci[0] = Td - Tg; |
145 | 0 | cr[WS(rs, 1)] = Td + Tg; |
146 | 0 | ci[WS(rs, 2)] = Tj + Ti; |
147 | 0 | Th = KP866025403 * (Tb - T6); |
148 | 0 | Tk = FNMS(KP500000000, Tj, Ti); |
149 | 0 | cr[WS(rs, 2)] = Th - Tk; |
150 | 0 | ci[WS(rs, 1)] = Th + Tk; |
151 | 0 | } |
152 | 0 | } |
153 | 0 | } |
154 | 0 | } |
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 | 1 | void X(codelet_hf_3) (planner *p) { |
164 | 1 | X(khc2hc_register) (p, hf_3, &desc); |
165 | 1 | } |
166 | | #endif |