comparison src/fftw-3.3.3/dft/simd/common/t1sv_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:39:23 EST 2012 */
23
24 #include "codelet-dft.h"
25
26 #ifdef HAVE_FMA
27
28 /* Generated by: ../../../genfft/gen_twiddle.native -fma -reorder-insns -schedule-for-pipeline -simd -compact -variables 4 -pipeline-latency 8 -n 2 -name t1sv_2 -include ts.h */
29
30 /*
31 * This function contains 6 FP additions, 4 FP multiplications,
32 * (or, 4 additions, 2 multiplications, 2 fused multiply/add),
33 * 11 stack variables, 0 constants, and 8 memory accesses
34 */
35 #include "ts.h"
36
37 static void t1sv_2(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms)
38 {
39 {
40 INT m;
41 for (m = mb, W = W + (mb * 2); m < me; m = m + (2 * VL), ri = ri + ((2 * VL) * ms), ii = ii + ((2 * VL) * ms), W = W + ((2 * VL) * 2), MAKE_VOLATILE_STRIDE(4, rs)) {
42 V T1, Ta, T3, T6, T2, T5;
43 T1 = LD(&(ri[0]), ms, &(ri[0]));
44 Ta = LD(&(ii[0]), ms, &(ii[0]));
45 T3 = LD(&(ri[WS(rs, 1)]), ms, &(ri[WS(rs, 1)]));
46 T6 = LD(&(ii[WS(rs, 1)]), ms, &(ii[WS(rs, 1)]));
47 T2 = LDW(&(W[0]));
48 T5 = LDW(&(W[TWVL * 1]));
49 {
50 V T8, T4, T9, T7;
51 T8 = VMUL(T2, T6);
52 T4 = VMUL(T2, T3);
53 T9 = VFNMS(T5, T3, T8);
54 T7 = VFMA(T5, T6, T4);
55 ST(&(ii[0]), VADD(T9, Ta), ms, &(ii[0]));
56 ST(&(ii[WS(rs, 1)]), VSUB(Ta, T9), ms, &(ii[WS(rs, 1)]));
57 ST(&(ri[0]), VADD(T1, T7), ms, &(ri[0]));
58 ST(&(ri[WS(rs, 1)]), VSUB(T1, T7), ms, &(ri[WS(rs, 1)]));
59 }
60 }
61 }
62 VLEAVE();
63 }
64
65 static const tw_instr twinstr[] = {
66 VTW(0, 1),
67 {TW_NEXT, (2 * VL), 0}
68 };
69
70 static const ct_desc desc = { 2, XSIMD_STRING("t1sv_2"), twinstr, &GENUS, {4, 2, 2, 0}, 0, 0, 0 };
71
72 void XSIMD(codelet_t1sv_2) (planner *p) {
73 X(kdft_dit_register) (p, t1sv_2, &desc);
74 }
75 #else /* HAVE_FMA */
76
77 /* Generated by: ../../../genfft/gen_twiddle.native -simd -compact -variables 4 -pipeline-latency 8 -n 2 -name t1sv_2 -include ts.h */
78
79 /*
80 * This function contains 6 FP additions, 4 FP multiplications,
81 * (or, 4 additions, 2 multiplications, 2 fused multiply/add),
82 * 9 stack variables, 0 constants, and 8 memory accesses
83 */
84 #include "ts.h"
85
86 static void t1sv_2(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms)
87 {
88 {
89 INT m;
90 for (m = mb, W = W + (mb * 2); m < me; m = m + (2 * VL), ri = ri + ((2 * VL) * ms), ii = ii + ((2 * VL) * ms), W = W + ((2 * VL) * 2), MAKE_VOLATILE_STRIDE(4, rs)) {
91 V T1, T8, T6, T7;
92 T1 = LD(&(ri[0]), ms, &(ri[0]));
93 T8 = LD(&(ii[0]), ms, &(ii[0]));
94 {
95 V T3, T5, T2, T4;
96 T3 = LD(&(ri[WS(rs, 1)]), ms, &(ri[WS(rs, 1)]));
97 T5 = LD(&(ii[WS(rs, 1)]), ms, &(ii[WS(rs, 1)]));
98 T2 = LDW(&(W[0]));
99 T4 = LDW(&(W[TWVL * 1]));
100 T6 = VFMA(T2, T3, VMUL(T4, T5));
101 T7 = VFNMS(T4, T3, VMUL(T2, T5));
102 }
103 ST(&(ri[WS(rs, 1)]), VSUB(T1, T6), ms, &(ri[WS(rs, 1)]));
104 ST(&(ii[WS(rs, 1)]), VSUB(T8, T7), ms, &(ii[WS(rs, 1)]));
105 ST(&(ri[0]), VADD(T1, T6), ms, &(ri[0]));
106 ST(&(ii[0]), VADD(T7, T8), ms, &(ii[0]));
107 }
108 }
109 VLEAVE();
110 }
111
112 static const tw_instr twinstr[] = {
113 VTW(0, 1),
114 {TW_NEXT, (2 * VL), 0}
115 };
116
117 static const ct_desc desc = { 2, XSIMD_STRING("t1sv_2"), twinstr, &GENUS, {4, 2, 2, 0}, 0, 0, 0 };
118
119 void XSIMD(codelet_t1sv_2) (planner *p) {
120 X(kdft_dit_register) (p, t1sv_2, &desc);
121 }
122 #endif /* HAVE_FMA */