view Lib/fftw-3.2.1/cell/spu/.svn/text-base/spu_n1fv_13.spuc.svn-base @ 9:262e084a15a9

Vectorised everything and made use of unique_ptr so there should be no more memory leaks. Hurrah for RAII
author Geogaddi\David <d.m.ronan@qmul.ac.uk>
date Wed, 12 Aug 2015 22:25:06 +0100
parents 25bf17994ef1
children
line wrap: on
line source
/*
 * Copyright (c) 2003, 2007-8 Matteo Frigo
 * Copyright (c) 2003, 2007-8 Massachusetts Institute of Technology
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
/* Generated by: ../../genfft/gen_notw_c -standalone -fma -reorder-insns -simd -compact -variables 100000 -with-ostride 2 -include fftw-spu.h -n 13 -name X(spu_n2fv_13) */

/*
 * This function contains 88 FP additions, 63 FP multiplications,
 * (or, 31 additions, 6 multiplications, 57 fused multiply/add),
 * 114 stack variables, 23 constants, and 26 memory accesses
 */
#include "fftw-spu.h"

void X(spu_n2fv_13) (const R *ri, const R *ii, R *ro, R *io, stride is, stride os, INT v, INT ivs, INT ovs) {
     DVK(KP904176221, +0.904176221990848204433795481776887926501523162);
     DVK(KP575140729, +0.575140729474003121368385547455453388461001608);
     DVK(KP516520780, +0.516520780623489722840901288569017135705033622);
     DVK(KP300462606, +0.300462606288665774426601772289207995520941381);
     DVK(KP251768516, +0.251768516431883313623436926934233488546674281);
     DVK(KP503537032, +0.503537032863766627246873853868466977093348562);
     DVK(KP083333333, +0.083333333333333333333333333333333333333333333);
     DVK(KP581704778, +0.581704778510515730456870384989698884939833902);
     DVK(KP859542535, +0.859542535098774820163672132761689612766401925);
     DVK(KP522026385, +0.522026385161275033714027226654165028300441940);
     DVK(KP957805992, +0.957805992594665126462521754605754580515587217);
     DVK(KP600477271, +0.600477271932665282925769253334763009352012849);
     DVK(KP853480001, +0.853480001859823990758994934970528322872359049);
     DVK(KP612264650, +0.612264650376756543746494474777125408779395514);
     DVK(KP038632954, +0.038632954644348171955506895830342264440241080);
     DVK(KP302775637, +0.302775637731994646559610633735247973125648287);
     DVK(KP769338817, +0.769338817572980603471413688209101117038278899);
     DVK(KP514918778, +0.514918778086315755491789696138117261566051239);
     DVK(KP686558370, +0.686558370781754340655719594850823015421401653);
     DVK(KP226109445, +0.226109445035782405468510155372505010481906348);
     DVK(KP301479260, +0.301479260047709873958013540496673347309208464);
     DVK(KP866025403, +0.866025403784438646763723170752936183471402627);
     DVK(KP500000000, +0.500000000000000000000000000000000000000000000);
     INT i;
     const R *xi;
     R *xo;
     xi = ri;
     xo = ro;
     for (i = v; i > 0; i = i - VL, xi = xi + (VL * ivs), xo = xo + (VL * ovs), MAKE_VOLATILE_STRIDE(is), MAKE_VOLATILE_STRIDE(os)) {
	  V T1, TX, TY, To, TH, TR, TU, TB, TE, Tw, TF, TM, TT, Tf, TN;
	  V Tq, Tb, Ty, Tr, Tx, T6, Tm, TL, Tv, TO, Td, Te, T7, Ta, T8;
	  V T9, T2, T5, T3, T4, Ti, Tt, Tl, Tu, Tg, Th, Tj, Tk, TP, TA;
	  V Tc, Tn, Ts, TK, TQ, Tz, T1k, T1c, T1n, T16, T1e, T1f, T1m, T10, TI;
	  V TD, T19, T1j, TC, TG, TZ, TS, TV, T1a, T1b, T15, T14, T12, T13, TW;
	  V T18, T17, Tp, T1l, T1o, T11, TJ, T1p, T1q, T1d, T1g, T1h, T1i;
	  T1 = LD(&(xi[0]), ivs, &(xi[0]));
	  Td = LD(&(xi[WS(is, 8)]), ivs, &(xi[0]));
	  Te = LD(&(xi[WS(is, 5)]), ivs, &(xi[WS(is, 1)]));
	  Tf = VADD(Td, Te);
	  TN = VSUB(Td, Te);
	  T7 = LD(&(xi[WS(is, 12)]), ivs, &(xi[0]));
	  T8 = LD(&(xi[WS(is, 10)]), ivs, &(xi[0]));
	  T9 = LD(&(xi[WS(is, 4)]), ivs, &(xi[0]));
	  Tq = VSUB(T8, T9);
	  Ta = VADD(T8, T9);
	  Tb = VADD(T7, Ta);
	  Ty = VFMS(LDK(KP500000000), Ta, T7);
	  T2 = LD(&(xi[WS(is, 1)]), ivs, &(xi[WS(is, 1)]));
	  T3 = LD(&(xi[WS(is, 3)]), ivs, &(xi[WS(is, 1)]));
	  T4 = LD(&(xi[WS(is, 9)]), ivs, &(xi[WS(is, 1)]));
	  T5 = VADD(T3, T4);
	  Tr = VSUB(T4, T3);
	  Tx = VFNMS(LDK(KP500000000), T5, T2);
	  T6 = VADD(T2, T5);
	  Tg = LD(&(xi[WS(is, 11)]), ivs, &(xi[WS(is, 1)]));
	  Th = LD(&(xi[WS(is, 6)]), ivs, &(xi[0]));
	  Ti = VADD(Tg, Th);
	  Tt = VSUB(Tg, Th);
	  Tj = LD(&(xi[WS(is, 7)]), ivs, &(xi[WS(is, 1)]));
	  Tk = LD(&(xi[WS(is, 2)]), ivs, &(xi[0]));
	  Tl = VADD(Tj, Tk);
	  Tu = VSUB(Tj, Tk);
	  Tm = VADD(Ti, Tl);
	  TL = VSUB(Ti, Tl);
	  Tv = VSUB(Tt, Tu);
	  TO = VADD(Tt, Tu);
	  TX = VSUB(T6, Tb);
	  Tc = VADD(T6, Tb);
	  TP = VFNMS(LDK(KP500000000), TO, TN);
	  TY = VADD(TN, TO);
	  TA = VFNMS(LDK(KP500000000), Tm, Tf);
	  Tn = VADD(Tf, Tm);
	  To = VADD(Tc, Tn);
	  TH = VSUB(Tc, Tn);
	  Ts = VSUB(Tq, Tr);
	  TQ = VADD(Tr, Tq);
	  TR = VFMA(LDK(KP866025403), TQ, TP);
	  TU = VFNMS(LDK(KP866025403), TQ, TP);
	  Tz = VSUB(Tx, Ty);
	  TK = VADD(Tx, Ty);
	  TB = VADD(Tz, TA);
	  TE = VSUB(Tz, TA);
	  Tw = VADD(Ts, Tv);
	  TF = VSUB(Ts, Tv);
	  TM = VFMA(LDK(KP866025403), TL, TK);
	  TT = VFNMS(LDK(KP866025403), TL, TK);
	  ST(&(xo[0]), VADD(T1, To), ovs, &(xo[0]));
	  TC = VFMA(LDK(KP301479260), TB, Tw);
	  T1a = VFNMS(LDK(KP226109445), Tw, TB);
	  T1b = VFMA(LDK(KP686558370), TE, TF);
	  TG = VFNMS(LDK(KP514918778), TF, TE);
	  T1k = VFMA(LDK(KP769338817), T1b, T1a);
	  T1c = VFNMS(LDK(KP769338817), T1b, T1a);
	  TZ = VFMA(LDK(KP302775637), TY, TX);
	  T15 = VFNMS(LDK(KP302775637), TX, TY);
	  T12 = VFMA(LDK(KP038632954), TM, TR);
	  TS = VFNMS(LDK(KP038632954), TR, TM);
	  TV = VFNMS(LDK(KP612264650), TU, TT);
	  T13 = VFMA(LDK(KP612264650), TT, TU);
	  T14 = VFNMS(LDK(KP853480001), T13, T12);
	  T1n = VFMA(LDK(KP853480001), T13, T12);
	  T16 = VMUL(LDK(KP600477271), VFMA(LDK(KP957805992), T15, T14));
	  T1e = VFNMS(LDK(KP522026385), T14, T15);
	  TW = VFNMS(LDK(KP853480001), TV, TS);
	  T1f = VFMA(LDK(KP853480001), TV, TS);
	  T1m = VFNMS(LDK(KP522026385), TW, TZ);
	  T10 = VMUL(LDK(KP600477271), VFMA(LDK(KP957805992), TZ, TW));
	  T18 = VFNMS(LDK(KP859542535), TG, TH);
	  TI = VFMA(LDK(KP581704778), TH, TG);
	  Tp = VFNMS(LDK(KP083333333), To, T1);
	  TD = VFMA(LDK(KP503537032), TC, Tp);
	  T17 = VFNMS(LDK(KP251768516), TC, Tp);
	  T19 = VFMA(LDK(KP300462606), T18, T17);
	  T1j = VFNMS(LDK(KP300462606), T18, T17);
	  TJ = VFNMS(LDK(KP516520780), TI, TD);
	  T11 = VFMA(LDK(KP516520780), TI, TD);
	  ST(&(xo[10]), VFNMSI(T10, TJ), ovs, &(xo[2]));
	  ST(&(xo[16]), VFMAI(T10, TJ), ovs, &(xo[0]));
	  ST(&(xo[2]), VFMAI(T16, T11), ovs, &(xo[2]));
	  ST(&(xo[24]), VFNMSI(T16, T11), ovs, &(xo[0]));
	  T1p = VFMA(LDK(KP503537032), T1k, T1j);
	  T1l = VFNMS(LDK(KP503537032), T1k, T1j);
	  T1o = VMUL(LDK(KP575140729), VFNMS(LDK(KP904176221), T1n, T1m));
	  T1q = VMUL(LDK(KP575140729), VFMA(LDK(KP904176221), T1n, T1m));
	  ST(&(xo[4]), VFNMSI(T1q, T1p), ovs, &(xo[0]));
	  ST(&(xo[22]), VFMAI(T1q, T1p), ovs, &(xo[2]));
	  ST(&(xo[12]), VFNMSI(T1o, T1l), ovs, &(xo[0]));
	  ST(&(xo[14]), VFMAI(T1o, T1l), ovs, &(xo[2]));
	  T1h = VFMA(LDK(KP503537032), T1c, T19);
	  T1d = VFNMS(LDK(KP503537032), T1c, T19);
	  T1g = VMUL(LDK(KP575140729), VFMA(LDK(KP904176221), T1f, T1e));
	  T1i = VMUL(LDK(KP575140729), VFNMS(LDK(KP904176221), T1f, T1e));
	  ST(&(xo[6]), VFMAI(T1i, T1h), ovs, &(xo[2]));
	  ST(&(xo[20]), VFNMSI(T1i, T1h), ovs, &(xo[0]));
	  ST(&(xo[8]), VFNMSI(T1g, T1d), ovs, &(xo[0]));
	  ST(&(xo[18]), VFMAI(T1g, T1d), ovs, &(xo[2]));
     }
}