/*
 * 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:51 EDT 2003 */

#include "codelet-dft.h"

/* Generated by: /homee/stevenj/cvs/fftw3.0.1/genfft/gen_notw_c -simd -compact -variables 4 -sign 1 -n 14 -name n2bv_14 -with-ostride 2 -include n2b.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 "n2b.h"

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

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