/*
 * Copyright (c) 2003 Matteo Frigo
 * Copyright (c) 2003 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
 *
 */

/* This file was automatically generated --- DO NOT EDIT */
/* Generated on Sat Jul  5 21:40:37 EDT 2003 */

#include "codelet-dft.h"

/* Generated by: /homee/stevenj/cvs/fftw3.0.1/genfft/gen_notw_c -simd -compact -variables 4 -n 14 -name n2fv_14 -with-ostride 2 -include n2f.h */

/*
 * This function contains 74 FP additions, 36 FP multiplications,
 * (or, 50 additions, 12 multiplications, 24 fused multiply/add),
 * 33 stack variables, and 28 memory accesses
 */
/*
 * Generator Id's : 
 * $Id: algsimp.ml,v 1.7 2003/03/15 20:29:42 stevenj Exp $
 * $Id: fft.ml,v 1.2 2003/03/15 20:29:42 stevenj Exp $
 * $Id: gen_notw_c.ml,v 1.9 2003/04/16 21:21:53 athena Exp $
 */

#include "n2f.h"

static void n2fv_14(const R *ri, const R *ii, R *ro, R *io, stride is, stride os, int v, int ivs, int ovs)
{
     DVK(KP222520933, +0.222520933956314404288902564496794759466355569);
     DVK(KP900968867, +0.900968867902419126236102319507445051165919162);
     DVK(KP623489801, +0.623489801858733530525004884004239810632274731);
     DVK(KP433883739, +0.433883739117558120475768332848358754609990728);
     DVK(KP781831482, +0.781831482468029808708444526674057750232334519);
     DVK(KP974927912, +0.974927912181823607018131682993931217232785801);
     int i;
     const R *xi;
     R *xo;
     xi = ri;
     xo = ro;
     BEGIN_SIMD();
     for (i = v; i > 0; i = i - VL, xi = xi + (VL * ivs), xo = xo + (VL * ovs)) {
	  V T3, Ty, To, TK, Tr, TE, Ta, TJ, Tq, TB, Th, TL, Ts, TH, T1;
	  V T2;
	  T1 = LD(&(xi[0]), ivs, &(xi[0]));
	  T2 = LD(&(xi[WS(is, 7)]), ivs, &(xi[WS(is, 1)]));
	  T3 = VSUB(T1, T2);
	  Ty = VADD(T1, T2);
	  {
	       V Tk, TC, Tn, TD;
	       {
		    V Ti, Tj, Tl, Tm;
		    Ti = LD(&(xi[WS(is, 6)]), ivs, &(xi[0]));
		    Tj = LD(&(xi[WS(is, 13)]), ivs, &(xi[WS(is, 1)]));
		    Tk = VSUB(Ti, Tj);
		    TC = VADD(Ti, Tj);
		    Tl = LD(&(xi[WS(is, 8)]), ivs, &(xi[0]));
		    Tm = LD(&(xi[WS(is, 1)]), ivs, &(xi[WS(is, 1)]));
		    Tn = VSUB(Tl, Tm);
		    TD = VADD(Tl, Tm);
	       }
	       To = VADD(Tk, Tn);
	       TK = VSUB(TC, TD);
	       Tr = VSUB(Tn, Tk);
	       TE = VADD(TC, TD);
	  }
	  {
	       V T6, Tz, T9, TA;
	       {
		    V T4, T5, T7, T8;
		    T4 = LD(&(xi[WS(is, 2)]), ivs, &(xi[0]));
		    T5 = LD(&(xi[WS(is, 9)]), ivs, &(xi[WS(is, 1)]));
		    T6 = VSUB(T4, T5);
		    Tz = VADD(T4, T5);
		    T7 = LD(&(xi[WS(is, 12)]), ivs, &(xi[0]));
		    T8 = LD(&(xi[WS(is, 5)]), ivs, &(xi[WS(is, 1)]));
		    T9 = VSUB(T7, T8);
		    TA = VADD(T7, T8);
	       }
	       Ta = VADD(T6, T9);
	       TJ = VSUB(TA, Tz);
	       Tq = VSUB(T9, T6);
	       TB = VADD(Tz, TA);
	  }
	  {
	       V Td, TF, Tg, TG;
	       {
		    V Tb, Tc, Te, Tf;
		    Tb = LD(&(xi[WS(is, 4)]), ivs, &(xi[0]));
		    Tc = LD(&(xi[WS(is, 11)]), ivs, &(xi[WS(is, 1)]));
		    Td = VSUB(Tb, Tc);
		    TF = VADD(Tb, Tc);
		    Te = LD(&(xi[WS(is, 10)]), ivs, &(xi[0]));
		    Tf = LD(&(xi[WS(is, 3)]), ivs, &(xi[WS(is, 1)]));
		    Tg = VSUB(Te, Tf);
		    TG = VADD(Te, Tf);
	       }
	       Th = VADD(Td, Tg);
	       TL = VSUB(TF, TG);
	       Ts = VSUB(Tg, Td);
	       TH = VADD(TF, TG);
	  }
	  ST(&(xo[14]), VADD(T3, VADD(Ta, VADD(Th, To))), ovs, &(xo[2]));
	  ST(&(xo[0]), VADD(Ty, VADD(TB, VADD(TH, TE))), ovs, &(xo[0]));
	  {
	       V Tt, Tp, TP, TQ;
	       Tt = VBYI(VFNMS(LDK(KP781831482), Tr, VFNMS(LDK(KP433883739), Ts, VMUL(LDK(KP974927912), Tq))));
	       Tp = VFMA(LDK(KP623489801), To, VFNMS(LDK(KP900968867), Th, VFNMS(LDK(KP222520933), Ta, T3)));
	       ST(&(xo[10]), VSUB(Tp, Tt), ovs, &(xo[2]));
	       ST(&(xo[18]), VADD(Tp, Tt), ovs, &(xo[2]));
	       TP = VBYI(VFMA(LDK(KP974927912), TJ, VFMA(LDK(KP433883739), TL, VMUL(LDK(KP781831482), TK))));
	       TQ = VFMA(LDK(KP623489801), TE, VFNMS(LDK(KP900968867), TH, VFNMS(LDK(KP222520933), TB, Ty)));
	       ST(&(xo[4]), VADD(TP, TQ), ovs, &(xo[0]));
	       ST(&(xo[24]), VSUB(TQ, TP), ovs, &(xo[0]));
	  }
	  {
	       V Tv, Tu, TM, TI;
	       Tv = VBYI(VFMA(LDK(KP781831482), Tq, VFMA(LDK(KP974927912), Ts, VMUL(LDK(KP433883739), Tr))));
	       Tu = VFMA(LDK(KP623489801), Ta, VFNMS(LDK(KP900968867), To, VFNMS(LDK(KP222520933), Th, T3)));
	       ST(&(xo[26]), VSUB(Tu, Tv), ovs, &(xo[2]));
	       ST(&(xo[2]), VADD(Tu, Tv), ovs, &(xo[2]));
	       TM = VBYI(VFNMS(LDK(KP433883739), TK, VFNMS(LDK(KP974927912), TL, VMUL(LDK(KP781831482), TJ))));
	       TI = VFMA(LDK(KP623489801), TB, VFNMS(LDK(KP900968867), TE, VFNMS(LDK(KP222520933), TH, Ty)));
	       ST(&(xo[12]), VSUB(TI, TM), ovs, &(xo[0]));
	       ST(&(xo[16]), VADD(TM, TI), ovs, &(xo[0]));
	  }
	  {
	       V TO, TN, Tx, Tw;
	       TO = VBYI(VFMA(LDK(KP433883739), TJ, VFNMS(LDK(KP974927912), TK, VMUL(LDK(KP781831482), TL))));
	       TN = VFMA(LDK(KP623489801), TH, VFNMS(LDK(KP222520933), TE, VFNMS(LDK(KP900968867), TB, Ty)));
	       ST(&(xo[8]), VSUB(TN, TO), ovs, &(xo[0]));
	       ST(&(xo[20]), VADD(TO, TN), ovs, &(xo[0]));
	       Tx = VBYI(VFMA(LDK(KP433883739), Tq, VFNMS(LDK(KP781831482), Ts, VMUL(LDK(KP974927912), Tr))));
	       Tw = VFMA(LDK(KP623489801), Th, VFNMS(LDK(KP222520933), To, VFNMS(LDK(KP900968867), Ta, T3)));
	       ST(&(xo[22]), VSUB(Tw, Tx), ovs, &(xo[2]));
	       ST(&(xo[6]), VADD(Tw, Tx), ovs, &(xo[2]));
	  }
     }
     END_SIMD();
}

static const kdft_desc desc = { 14, "n2fv_14", {50, 12, 24, 0}, &GENUS, 0, 2, 0, 0 };
void X(codelet_n2fv_14) (planner *p) {
     X(kdft_register) (p, n2fv_14, &desc);
}
