annotate src/fftw-3.3.8/dft/simd/common/n1bv_12.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
rev   line source
cannam@167 1 /*
cannam@167 2 * Copyright (c) 2003, 2007-14 Matteo Frigo
cannam@167 3 * Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
cannam@167 4 *
cannam@167 5 * This program is free software; you can redistribute it and/or modify
cannam@167 6 * it under the terms of the GNU General Public License as published by
cannam@167 7 * the Free Software Foundation; either version 2 of the License, or
cannam@167 8 * (at your option) any later version.
cannam@167 9 *
cannam@167 10 * This program is distributed in the hope that it will be useful,
cannam@167 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cannam@167 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cannam@167 13 * GNU General Public License for more details.
cannam@167 14 *
cannam@167 15 * You should have received a copy of the GNU General Public License
cannam@167 16 * along with this program; if not, write to the Free Software
cannam@167 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
cannam@167 18 *
cannam@167 19 */
cannam@167 20
cannam@167 21 /* This file was automatically generated --- DO NOT EDIT */
cannam@167 22 /* Generated on Thu May 24 08:04:57 EDT 2018 */
cannam@167 23
cannam@167 24 #include "dft/codelet-dft.h"
cannam@167 25
cannam@167 26 #if defined(ARCH_PREFERS_FMA) || defined(ISA_EXTENSION_PREFERS_FMA)
cannam@167 27
cannam@167 28 /* Generated by: ../../../genfft/gen_notw_c.native -fma -simd -compact -variables 4 -pipeline-latency 8 -sign 1 -n 12 -name n1bv_12 -include dft/simd/n1b.h */
cannam@167 29
cannam@167 30 /*
cannam@167 31 * This function contains 48 FP additions, 20 FP multiplications,
cannam@167 32 * (or, 30 additions, 2 multiplications, 18 fused multiply/add),
cannam@167 33 * 27 stack variables, 2 constants, and 24 memory accesses
cannam@167 34 */
cannam@167 35 #include "dft/simd/n1b.h"
cannam@167 36
cannam@167 37 static void n1bv_12(const R *ri, const R *ii, R *ro, R *io, stride is, stride os, INT v, INT ivs, INT ovs)
cannam@167 38 {
cannam@167 39 DVK(KP866025403, +0.866025403784438646763723170752936183471402627);
cannam@167 40 DVK(KP500000000, +0.500000000000000000000000000000000000000000000);
cannam@167 41 {
cannam@167 42 INT i;
cannam@167 43 const R *xi;
cannam@167 44 R *xo;
cannam@167 45 xi = ii;
cannam@167 46 xo = io;
cannam@167 47 for (i = v; i > 0; i = i - VL, xi = xi + (VL * ivs), xo = xo + (VL * ovs), MAKE_VOLATILE_STRIDE(24, is), MAKE_VOLATILE_STRIDE(24, os)) {
cannam@167 48 V T5, Ta, TJ, TB, Tq, Tp, Tg, Tl, TG, Ty, Tt, Ts;
cannam@167 49 {
cannam@167 50 V T1, T6, T4, Tz, T9, TA;
cannam@167 51 T1 = LD(&(xi[0]), ivs, &(xi[0]));
cannam@167 52 T6 = LD(&(xi[WS(is, 6)]), ivs, &(xi[0]));
cannam@167 53 {
cannam@167 54 V T2, T3, T7, T8;
cannam@167 55 T2 = LD(&(xi[WS(is, 4)]), ivs, &(xi[0]));
cannam@167 56 T3 = LD(&(xi[WS(is, 8)]), ivs, &(xi[0]));
cannam@167 57 T4 = VADD(T2, T3);
cannam@167 58 Tz = VSUB(T2, T3);
cannam@167 59 T7 = LD(&(xi[WS(is, 10)]), ivs, &(xi[0]));
cannam@167 60 T8 = LD(&(xi[WS(is, 2)]), ivs, &(xi[0]));
cannam@167 61 T9 = VADD(T7, T8);
cannam@167 62 TA = VSUB(T7, T8);
cannam@167 63 }
cannam@167 64 T5 = VADD(T1, T4);
cannam@167 65 Ta = VADD(T6, T9);
cannam@167 66 TJ = VSUB(Tz, TA);
cannam@167 67 TB = VADD(Tz, TA);
cannam@167 68 Tq = VFNMS(LDK(KP500000000), T9, T6);
cannam@167 69 Tp = VFNMS(LDK(KP500000000), T4, T1);
cannam@167 70 }
cannam@167 71 {
cannam@167 72 V Tc, Th, Tf, Tw, Tk, Tx;
cannam@167 73 Tc = LD(&(xi[WS(is, 3)]), ivs, &(xi[WS(is, 1)]));
cannam@167 74 Th = LD(&(xi[WS(is, 9)]), ivs, &(xi[WS(is, 1)]));
cannam@167 75 {
cannam@167 76 V Td, Te, Ti, Tj;
cannam@167 77 Td = LD(&(xi[WS(is, 7)]), ivs, &(xi[WS(is, 1)]));
cannam@167 78 Te = LD(&(xi[WS(is, 11)]), ivs, &(xi[WS(is, 1)]));
cannam@167 79 Tf = VADD(Td, Te);
cannam@167 80 Tw = VSUB(Td, Te);
cannam@167 81 Ti = LD(&(xi[WS(is, 1)]), ivs, &(xi[WS(is, 1)]));
cannam@167 82 Tj = LD(&(xi[WS(is, 5)]), ivs, &(xi[WS(is, 1)]));
cannam@167 83 Tk = VADD(Ti, Tj);
cannam@167 84 Tx = VSUB(Tj, Ti);
cannam@167 85 }
cannam@167 86 Tg = VADD(Tc, Tf);
cannam@167 87 Tl = VADD(Th, Tk);
cannam@167 88 TG = VADD(Tw, Tx);
cannam@167 89 Ty = VSUB(Tw, Tx);
cannam@167 90 Tt = VFNMS(LDK(KP500000000), Tk, Th);
cannam@167 91 Ts = VFNMS(LDK(KP500000000), Tf, Tc);
cannam@167 92 }
cannam@167 93 {
cannam@167 94 V Tb, Tm, Tn, To;
cannam@167 95 Tb = VSUB(T5, Ta);
cannam@167 96 Tm = VSUB(Tg, Tl);
cannam@167 97 ST(&(xo[WS(os, 3)]), VFNMSI(Tm, Tb), ovs, &(xo[WS(os, 1)]));
cannam@167 98 ST(&(xo[WS(os, 9)]), VFMAI(Tm, Tb), ovs, &(xo[WS(os, 1)]));
cannam@167 99 Tn = VADD(T5, Ta);
cannam@167 100 To = VADD(Tg, Tl);
cannam@167 101 ST(&(xo[WS(os, 6)]), VSUB(Tn, To), ovs, &(xo[0]));
cannam@167 102 ST(&(xo[0]), VADD(Tn, To), ovs, &(xo[0]));
cannam@167 103 }
cannam@167 104 {
cannam@167 105 V TC, TE, Tv, TD, Tr, Tu;
cannam@167 106 TC = VMUL(LDK(KP866025403), VSUB(Ty, TB));
cannam@167 107 TE = VMUL(LDK(KP866025403), VADD(TB, Ty));
cannam@167 108 Tr = VADD(Tp, Tq);
cannam@167 109 Tu = VADD(Ts, Tt);
cannam@167 110 Tv = VSUB(Tr, Tu);
cannam@167 111 TD = VADD(Tr, Tu);
cannam@167 112 ST(&(xo[WS(os, 10)]), VFNMSI(TC, Tv), ovs, &(xo[0]));
cannam@167 113 ST(&(xo[WS(os, 4)]), VFMAI(TE, TD), ovs, &(xo[0]));
cannam@167 114 ST(&(xo[WS(os, 2)]), VFMAI(TC, Tv), ovs, &(xo[0]));
cannam@167 115 ST(&(xo[WS(os, 8)]), VFNMSI(TE, TD), ovs, &(xo[0]));
cannam@167 116 }
cannam@167 117 {
cannam@167 118 V TH, TL, TK, TM, TF, TI;
cannam@167 119 TF = VSUB(Tp, Tq);
cannam@167 120 TH = VFNMS(LDK(KP866025403), TG, TF);
cannam@167 121 TL = VFMA(LDK(KP866025403), TG, TF);
cannam@167 122 TI = VSUB(Ts, Tt);
cannam@167 123 TK = VFMA(LDK(KP866025403), TJ, TI);
cannam@167 124 TM = VFNMS(LDK(KP866025403), TJ, TI);
cannam@167 125 ST(&(xo[WS(os, 1)]), VFMAI(TK, TH), ovs, &(xo[WS(os, 1)]));
cannam@167 126 ST(&(xo[WS(os, 7)]), VFNMSI(TM, TL), ovs, &(xo[WS(os, 1)]));
cannam@167 127 ST(&(xo[WS(os, 11)]), VFNMSI(TK, TH), ovs, &(xo[WS(os, 1)]));
cannam@167 128 ST(&(xo[WS(os, 5)]), VFMAI(TM, TL), ovs, &(xo[WS(os, 1)]));
cannam@167 129 }
cannam@167 130 }
cannam@167 131 }
cannam@167 132 VLEAVE();
cannam@167 133 }
cannam@167 134
cannam@167 135 static const kdft_desc desc = { 12, XSIMD_STRING("n1bv_12"), {30, 2, 18, 0}, &GENUS, 0, 0, 0, 0 };
cannam@167 136
cannam@167 137 void XSIMD(codelet_n1bv_12) (planner *p) {
cannam@167 138 X(kdft_register) (p, n1bv_12, &desc);
cannam@167 139 }
cannam@167 140
cannam@167 141 #else
cannam@167 142
cannam@167 143 /* Generated by: ../../../genfft/gen_notw_c.native -simd -compact -variables 4 -pipeline-latency 8 -sign 1 -n 12 -name n1bv_12 -include dft/simd/n1b.h */
cannam@167 144
cannam@167 145 /*
cannam@167 146 * This function contains 48 FP additions, 8 FP multiplications,
cannam@167 147 * (or, 44 additions, 4 multiplications, 4 fused multiply/add),
cannam@167 148 * 27 stack variables, 2 constants, and 24 memory accesses
cannam@167 149 */
cannam@167 150 #include "dft/simd/n1b.h"
cannam@167 151
cannam@167 152 static void n1bv_12(const R *ri, const R *ii, R *ro, R *io, stride is, stride os, INT v, INT ivs, INT ovs)
cannam@167 153 {
cannam@167 154 DVK(KP866025403, +0.866025403784438646763723170752936183471402627);
cannam@167 155 DVK(KP500000000, +0.500000000000000000000000000000000000000000000);
cannam@167 156 {
cannam@167 157 INT i;
cannam@167 158 const R *xi;
cannam@167 159 R *xo;
cannam@167 160 xi = ii;
cannam@167 161 xo = io;
cannam@167 162 for (i = v; i > 0; i = i - VL, xi = xi + (VL * ivs), xo = xo + (VL * ovs), MAKE_VOLATILE_STRIDE(24, is), MAKE_VOLATILE_STRIDE(24, os)) {
cannam@167 163 V T5, Ta, TG, TF, Ty, Tm, Ti, Tp, TJ, TI, Tx, Ts;
cannam@167 164 {
cannam@167 165 V T1, T6, T4, Tk, T9, Tl;
cannam@167 166 T1 = LD(&(xi[0]), ivs, &(xi[0]));
cannam@167 167 T6 = LD(&(xi[WS(is, 6)]), ivs, &(xi[0]));
cannam@167 168 {
cannam@167 169 V T2, T3, T7, T8;
cannam@167 170 T2 = LD(&(xi[WS(is, 4)]), ivs, &(xi[0]));
cannam@167 171 T3 = LD(&(xi[WS(is, 8)]), ivs, &(xi[0]));
cannam@167 172 T4 = VADD(T2, T3);
cannam@167 173 Tk = VSUB(T2, T3);
cannam@167 174 T7 = LD(&(xi[WS(is, 10)]), ivs, &(xi[0]));
cannam@167 175 T8 = LD(&(xi[WS(is, 2)]), ivs, &(xi[0]));
cannam@167 176 T9 = VADD(T7, T8);
cannam@167 177 Tl = VSUB(T7, T8);
cannam@167 178 }
cannam@167 179 T5 = VFNMS(LDK(KP500000000), T4, T1);
cannam@167 180 Ta = VFNMS(LDK(KP500000000), T9, T6);
cannam@167 181 TG = VADD(T6, T9);
cannam@167 182 TF = VADD(T1, T4);
cannam@167 183 Ty = VADD(Tk, Tl);
cannam@167 184 Tm = VMUL(LDK(KP866025403), VSUB(Tk, Tl));
cannam@167 185 }
cannam@167 186 {
cannam@167 187 V Tn, Tq, Te, To, Th, Tr;
cannam@167 188 Tn = LD(&(xi[WS(is, 3)]), ivs, &(xi[WS(is, 1)]));
cannam@167 189 Tq = LD(&(xi[WS(is, 9)]), ivs, &(xi[WS(is, 1)]));
cannam@167 190 {
cannam@167 191 V Tc, Td, Tf, Tg;
cannam@167 192 Tc = LD(&(xi[WS(is, 7)]), ivs, &(xi[WS(is, 1)]));
cannam@167 193 Td = LD(&(xi[WS(is, 11)]), ivs, &(xi[WS(is, 1)]));
cannam@167 194 Te = VSUB(Tc, Td);
cannam@167 195 To = VADD(Tc, Td);
cannam@167 196 Tf = LD(&(xi[WS(is, 1)]), ivs, &(xi[WS(is, 1)]));
cannam@167 197 Tg = LD(&(xi[WS(is, 5)]), ivs, &(xi[WS(is, 1)]));
cannam@167 198 Th = VSUB(Tf, Tg);
cannam@167 199 Tr = VADD(Tf, Tg);
cannam@167 200 }
cannam@167 201 Ti = VMUL(LDK(KP866025403), VSUB(Te, Th));
cannam@167 202 Tp = VFNMS(LDK(KP500000000), To, Tn);
cannam@167 203 TJ = VADD(Tq, Tr);
cannam@167 204 TI = VADD(Tn, To);
cannam@167 205 Tx = VADD(Te, Th);
cannam@167 206 Ts = VFNMS(LDK(KP500000000), Tr, Tq);
cannam@167 207 }
cannam@167 208 {
cannam@167 209 V TH, TK, TL, TM;
cannam@167 210 TH = VSUB(TF, TG);
cannam@167 211 TK = VBYI(VSUB(TI, TJ));
cannam@167 212 ST(&(xo[WS(os, 3)]), VSUB(TH, TK), ovs, &(xo[WS(os, 1)]));
cannam@167 213 ST(&(xo[WS(os, 9)]), VADD(TH, TK), ovs, &(xo[WS(os, 1)]));
cannam@167 214 TL = VADD(TF, TG);
cannam@167 215 TM = VADD(TI, TJ);
cannam@167 216 ST(&(xo[WS(os, 6)]), VSUB(TL, TM), ovs, &(xo[0]));
cannam@167 217 ST(&(xo[0]), VADD(TL, TM), ovs, &(xo[0]));
cannam@167 218 }
cannam@167 219 {
cannam@167 220 V Tj, Tv, Tu, Tw, Tb, Tt;
cannam@167 221 Tb = VSUB(T5, Ta);
cannam@167 222 Tj = VSUB(Tb, Ti);
cannam@167 223 Tv = VADD(Tb, Ti);
cannam@167 224 Tt = VSUB(Tp, Ts);
cannam@167 225 Tu = VBYI(VADD(Tm, Tt));
cannam@167 226 Tw = VBYI(VSUB(Tt, Tm));
cannam@167 227 ST(&(xo[WS(os, 11)]), VSUB(Tj, Tu), ovs, &(xo[WS(os, 1)]));
cannam@167 228 ST(&(xo[WS(os, 5)]), VADD(Tv, Tw), ovs, &(xo[WS(os, 1)]));
cannam@167 229 ST(&(xo[WS(os, 1)]), VADD(Tj, Tu), ovs, &(xo[WS(os, 1)]));
cannam@167 230 ST(&(xo[WS(os, 7)]), VSUB(Tv, Tw), ovs, &(xo[WS(os, 1)]));
cannam@167 231 }
cannam@167 232 {
cannam@167 233 V Tz, TD, TC, TE, TA, TB;
cannam@167 234 Tz = VBYI(VMUL(LDK(KP866025403), VSUB(Tx, Ty)));
cannam@167 235 TD = VBYI(VMUL(LDK(KP866025403), VADD(Ty, Tx)));
cannam@167 236 TA = VADD(T5, Ta);
cannam@167 237 TB = VADD(Tp, Ts);
cannam@167 238 TC = VSUB(TA, TB);
cannam@167 239 TE = VADD(TA, TB);
cannam@167 240 ST(&(xo[WS(os, 2)]), VADD(Tz, TC), ovs, &(xo[0]));
cannam@167 241 ST(&(xo[WS(os, 8)]), VSUB(TE, TD), ovs, &(xo[0]));
cannam@167 242 ST(&(xo[WS(os, 10)]), VSUB(TC, Tz), ovs, &(xo[0]));
cannam@167 243 ST(&(xo[WS(os, 4)]), VADD(TD, TE), ovs, &(xo[0]));
cannam@167 244 }
cannam@167 245 }
cannam@167 246 }
cannam@167 247 VLEAVE();
cannam@167 248 }
cannam@167 249
cannam@167 250 static const kdft_desc desc = { 12, XSIMD_STRING("n1bv_12"), {44, 4, 4, 0}, &GENUS, 0, 0, 0, 0 };
cannam@167 251
cannam@167 252 void XSIMD(codelet_n1bv_12) (planner *p) {
cannam@167 253 X(kdft_register) (p, n1bv_12, &desc);
cannam@167 254 }
cannam@167 255
cannam@167 256 #endif