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