/*
 * 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:45 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 10 -name n2bv_10 -with-ostride 2 -include n2b.h */

/*
 * This function contains 42 FP additions, 12 FP multiplications,
 * (or, 36 additions, 6 multiplications, 6 fused multiply/add),
 * 33 stack variables, and 20 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_10(const R *ri, const R *ii, R *ro, R *io, stride is, stride os, int v, int ivs, int ovs)
{
     DVK(KP250000000, +0.250000000000000000000000000000000000000000000);
     DVK(KP559016994, +0.559016994374947424102293417182819058860154590);
     DVK(KP587785252, +0.587785252292473129168705954639072768597652438);
     DVK(KP951056516, +0.951056516295153572116439333379382143405698634);
     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 Tl, Ty, T7, Te, Tw, Tt, Tz, TA, TB, Tg, Th, Tm, Tj, Tk;
	  Tj = LD(&(xi[0]), ivs, &(xi[0]));
	  Tk = LD(&(xi[WS(is, 5)]), ivs, &(xi[WS(is, 1)]));
	  Tl = VSUB(Tj, Tk);
	  Ty = VADD(Tj, Tk);
	  {
	       V T3, Tr, Td, Tv, T6, Ts, Ta, Tu;
	       {
		    V T1, T2, Tb, Tc;
		    T1 = LD(&(xi[WS(is, 2)]), ivs, &(xi[0]));
		    T2 = LD(&(xi[WS(is, 7)]), ivs, &(xi[WS(is, 1)]));
		    T3 = VSUB(T1, T2);
		    Tr = VADD(T1, T2);
		    Tb = LD(&(xi[WS(is, 6)]), ivs, &(xi[0]));
		    Tc = LD(&(xi[WS(is, 1)]), ivs, &(xi[WS(is, 1)]));
		    Td = VSUB(Tb, Tc);
		    Tv = VADD(Tb, Tc);
	       }
	       {
		    V T4, T5, T8, T9;
		    T4 = LD(&(xi[WS(is, 8)]), ivs, &(xi[0]));
		    T5 = LD(&(xi[WS(is, 3)]), ivs, &(xi[WS(is, 1)]));
		    T6 = VSUB(T4, T5);
		    Ts = VADD(T4, T5);
		    T8 = LD(&(xi[WS(is, 4)]), ivs, &(xi[0]));
		    T9 = LD(&(xi[WS(is, 9)]), ivs, &(xi[WS(is, 1)]));
		    Ta = VSUB(T8, T9);
		    Tu = VADD(T8, T9);
	       }
	       T7 = VSUB(T3, T6);
	       Te = VSUB(Ta, Td);
	       Tw = VSUB(Tu, Tv);
	       Tt = VSUB(Tr, Ts);
	       Tz = VADD(Tr, Ts);
	       TA = VADD(Tu, Tv);
	       TB = VADD(Tz, TA);
	       Tg = VADD(T3, T6);
	       Th = VADD(Ta, Td);
	       Tm = VADD(Tg, Th);
	  }
	  ST(&(xo[10]), VADD(Tl, Tm), ovs, &(xo[2]));
	  ST(&(xo[0]), VADD(Ty, TB), ovs, &(xo[0]));
	  {
	       V Tf, Tq, To, Tp, Ti, Tn;
	       Tf = VBYI(VFMA(LDK(KP951056516), T7, VMUL(LDK(KP587785252), Te)));
	       Tq = VBYI(VFNMS(LDK(KP951056516), Te, VMUL(LDK(KP587785252), T7)));
	       Ti = VMUL(LDK(KP559016994), VSUB(Tg, Th));
	       Tn = VFNMS(LDK(KP250000000), Tm, Tl);
	       To = VADD(Ti, Tn);
	       Tp = VSUB(Tn, Ti);
	       ST(&(xo[2]), VADD(Tf, To), ovs, &(xo[2]));
	       ST(&(xo[14]), VADD(Tq, Tp), ovs, &(xo[2]));
	       ST(&(xo[18]), VSUB(To, Tf), ovs, &(xo[2]));
	       ST(&(xo[6]), VSUB(Tp, Tq), ovs, &(xo[2]));
	  }
	  {
	       V Tx, TG, TE, TF, TC, TD;
	       Tx = VBYI(VFNMS(LDK(KP951056516), Tw, VMUL(LDK(KP587785252), Tt)));
	       TG = VBYI(VFMA(LDK(KP951056516), Tt, VMUL(LDK(KP587785252), Tw)));
	       TC = VFNMS(LDK(KP250000000), TB, Ty);
	       TD = VMUL(LDK(KP559016994), VSUB(Tz, TA));
	       TE = VSUB(TC, TD);
	       TF = VADD(TD, TC);
	       ST(&(xo[4]), VADD(Tx, TE), ovs, &(xo[0]));
	       ST(&(xo[12]), VADD(TG, TF), ovs, &(xo[0]));
	       ST(&(xo[16]), VSUB(TE, Tx), ovs, &(xo[0]));
	       ST(&(xo[8]), VSUB(TF, TG), ovs, &(xo[0]));
	  }
     }
     END_SIMD();
}

static const kdft_desc desc = { 10, "n2bv_10", {36, 6, 6, 0}, &GENUS, 0, 2, 0, 0 };
void X(codelet_n2bv_10) (planner *p) {
     X(kdft_register) (p, n2bv_10, &desc);
}
