comparison src/fftw-3.3.3/rdft/scalar/r2cb/hc2cbdft_2.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:42:03 EST 2012 */
23
24 #include "codelet-rdft.h"
25
26 #ifdef HAVE_FMA
27
28 /* Generated by: ../../../genfft/gen_hc2cdft.native -fma -reorder-insns -schedule-for-pipeline -compact -variables 4 -pipeline-latency 4 -sign 1 -n 2 -dif -name hc2cbdft_2 -include hc2cb.h */
29
30 /*
31 * This function contains 10 FP additions, 4 FP multiplications,
32 * (or, 8 additions, 2 multiplications, 2 fused multiply/add),
33 * 11 stack variables, 0 constants, and 8 memory accesses
34 */
35 #include "hc2cb.h"
36
37 static void hc2cbdft_2(R *Rp, R *Ip, R *Rm, R *Im, const R *W, stride rs, INT mb, INT me, INT ms)
38 {
39 {
40 INT m;
41 for (m = mb, W = W + ((mb - 1) * 2); m < me; m = m + 1, Rp = Rp + ms, Ip = Ip + ms, Rm = Rm - ms, Im = Im - ms, W = W + 2, MAKE_VOLATILE_STRIDE(8, rs)) {
42 E T9, Ta, T3, Tc, T7, T4;
43 {
44 E T1, T2, T5, T6;
45 T1 = Ip[0];
46 T2 = Im[0];
47 T5 = Rp[0];
48 T6 = Rm[0];
49 T9 = W[1];
50 Ta = T1 + T2;
51 T3 = T1 - T2;
52 Tc = T5 + T6;
53 T7 = T5 - T6;
54 T4 = W[0];
55 }
56 {
57 E Td, T8, Te, Tb;
58 Td = T9 * T7;
59 T8 = T4 * T7;
60 Te = FMA(T4, Ta, Td);
61 Tb = FNMS(T9, Ta, T8);
62 Rm[0] = Tc + Te;
63 Rp[0] = Tc - Te;
64 Im[0] = Tb - T3;
65 Ip[0] = T3 + Tb;
66 }
67 }
68 }
69 }
70
71 static const tw_instr twinstr[] = {
72 {TW_FULL, 1, 2},
73 {TW_NEXT, 1, 0}
74 };
75
76 static const hc2c_desc desc = { 2, "hc2cbdft_2", twinstr, &GENUS, {8, 2, 2, 0} };
77
78 void X(codelet_hc2cbdft_2) (planner *p) {
79 X(khc2c_register) (p, hc2cbdft_2, &desc, HC2C_VIA_DFT);
80 }
81 #else /* HAVE_FMA */
82
83 /* Generated by: ../../../genfft/gen_hc2cdft.native -compact -variables 4 -pipeline-latency 4 -sign 1 -n 2 -dif -name hc2cbdft_2 -include hc2cb.h */
84
85 /*
86 * This function contains 10 FP additions, 4 FP multiplications,
87 * (or, 8 additions, 2 multiplications, 2 fused multiply/add),
88 * 9 stack variables, 0 constants, and 8 memory accesses
89 */
90 #include "hc2cb.h"
91
92 static void hc2cbdft_2(R *Rp, R *Ip, R *Rm, R *Im, const R *W, stride rs, INT mb, INT me, INT ms)
93 {
94 {
95 INT m;
96 for (m = mb, W = W + ((mb - 1) * 2); m < me; m = m + 1, Rp = Rp + ms, Ip = Ip + ms, Rm = Rm - ms, Im = Im - ms, W = W + 2, MAKE_VOLATILE_STRIDE(8, rs)) {
97 E T3, T9, T7, Tb;
98 {
99 E T1, T2, T5, T6;
100 T1 = Ip[0];
101 T2 = Im[0];
102 T3 = T1 - T2;
103 T9 = T1 + T2;
104 T5 = Rp[0];
105 T6 = Rm[0];
106 T7 = T5 - T6;
107 Tb = T5 + T6;
108 }
109 {
110 E Ta, Tc, T4, T8;
111 T4 = W[0];
112 T8 = W[1];
113 Ta = FNMS(T8, T9, T4 * T7);
114 Tc = FMA(T8, T7, T4 * T9);
115 Ip[0] = T3 + Ta;
116 Rp[0] = Tb - Tc;
117 Im[0] = Ta - T3;
118 Rm[0] = Tb + Tc;
119 }
120 }
121 }
122 }
123
124 static const tw_instr twinstr[] = {
125 {TW_FULL, 1, 2},
126 {TW_NEXT, 1, 0}
127 };
128
129 static const hc2c_desc desc = { 2, "hc2cbdft_2", twinstr, &GENUS, {8, 2, 2, 0} };
130
131 void X(codelet_hc2cbdft_2) (planner *p) {
132 X(khc2c_register) (p, hc2cbdft_2, &desc, HC2C_VIA_DFT);
133 }
134 #endif /* HAVE_FMA */