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

#include "codelet-dft.h"

/* Generated by: /homee/stevenj/cvs/fftw3.0.1/genfft/gen_twiddle_c -simd -compact -variables 4 -n 15 -name t1bv_15 -include t1b.h -sign 1 */

/*
 * This function contains 92 FP additions, 53 FP multiplications,
 * (or, 78 additions, 39 multiplications, 14 fused multiply/add),
 * 52 stack variables, and 30 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_twiddle_c.ml,v 1.7 2003/04/16 19:51:27 athena Exp $
 */

#include "t1b.h"

static const R *t1bv_15(R *ri, R *ii, const R *W, stride ios, int m, int dist)
{
     DVK(KP216506350, +0.216506350946109661690930792688234045867850657);
     DVK(KP484122918, +0.484122918275927110647408174972799951354115213);
     DVK(KP866025403, +0.866025403784438646763723170752936183471402627);
     DVK(KP509036960, +0.509036960455127183450980863393907648510733164);
     DVK(KP823639103, +0.823639103546331925877420039278190003029660514);
     DVK(KP951056516, +0.951056516295153572116439333379382143405698634);
     DVK(KP587785252, +0.587785252292473129168705954639072768597652438);
     DVK(KP250000000, +0.250000000000000000000000000000000000000000000);
     DVK(KP559016994, +0.559016994374947424102293417182819058860154590);
     DVK(KP500000000, +0.500000000000000000000000000000000000000000000);
     int i;
     R *x;
     x = ii;
     BEGIN_SIMD();
     for (i = m; i > 0; i = i - VL, x = x + (VL * dist), W = W + (TWVL * 28)) {
	  V Ts, TV, T1f, TZ, T10, Tb, Tm, Tt, T1j, T1k, T1l, TI, TM, TR, Tz;
	  V TD, TQ, T1g, T1h, T1i;
	  {
	       V TT, Tr, Tp, Tq, To, TU;
	       TT = LD(&(x[0]), dist, &(x[0]));
	       Tq = LD(&(x[WS(ios, 10)]), dist, &(x[0]));
	       Tr = BYTW(&(W[TWVL * 18]), Tq);
	       To = LD(&(x[WS(ios, 5)]), dist, &(x[WS(ios, 1)]));
	       Tp = BYTW(&(W[TWVL * 8]), To);
	       Ts = VSUB(Tp, Tr);
	       TU = VADD(Tp, Tr);
	       TV = VFNMS(LDK(KP500000000), TU, TT);
	       T1f = VADD(TT, TU);
	  }
	  {
	       V Tx, TG, TK, TB, T5, Ty, Tg, TH, Tl, TL, Ta, TC;
	       {
		    V Tw, TF, TJ, TA;
		    Tw = LD(&(x[WS(ios, 3)]), dist, &(x[WS(ios, 1)]));
		    Tx = BYTW(&(W[TWVL * 4]), Tw);
		    TF = LD(&(x[WS(ios, 6)]), dist, &(x[0]));
		    TG = BYTW(&(W[TWVL * 10]), TF);
		    TJ = LD(&(x[WS(ios, 9)]), dist, &(x[WS(ios, 1)]));
		    TK = BYTW(&(W[TWVL * 16]), TJ);
		    TA = LD(&(x[WS(ios, 12)]), dist, &(x[0]));
		    TB = BYTW(&(W[TWVL * 22]), TA);
	       }
	       {
		    V T2, T4, T1, T3;
		    T1 = LD(&(x[WS(ios, 8)]), dist, &(x[0]));
		    T2 = BYTW(&(W[TWVL * 14]), T1);
		    T3 = LD(&(x[WS(ios, 13)]), dist, &(x[WS(ios, 1)]));
		    T4 = BYTW(&(W[TWVL * 24]), T3);
		    T5 = VSUB(T2, T4);
		    Ty = VADD(T2, T4);
	       }
	       {
		    V Td, Tf, Tc, Te;
		    Tc = LD(&(x[WS(ios, 11)]), dist, &(x[WS(ios, 1)]));
		    Td = BYTW(&(W[TWVL * 20]), Tc);
		    Te = LD(&(x[WS(ios, 1)]), dist, &(x[WS(ios, 1)]));
		    Tf = BYTW(&(W[0]), Te);
		    Tg = VSUB(Td, Tf);
		    TH = VADD(Td, Tf);
	       }
	       {
		    V Ti, Tk, Th, Tj;
		    Th = LD(&(x[WS(ios, 14)]), dist, &(x[0]));
		    Ti = BYTW(&(W[TWVL * 26]), Th);
		    Tj = LD(&(x[WS(ios, 4)]), dist, &(x[0]));
		    Tk = BYTW(&(W[TWVL * 6]), Tj);
		    Tl = VSUB(Ti, Tk);
		    TL = VADD(Ti, Tk);
	       }
	       {
		    V T7, T9, T6, T8;
		    T6 = LD(&(x[WS(ios, 2)]), dist, &(x[0]));
		    T7 = BYTW(&(W[TWVL * 2]), T6);
		    T8 = LD(&(x[WS(ios, 7)]), dist, &(x[WS(ios, 1)]));
		    T9 = BYTW(&(W[TWVL * 12]), T8);
		    Ta = VSUB(T7, T9);
		    TC = VADD(T7, T9);
	       }
	       TZ = VSUB(T5, Ta);
	       T10 = VSUB(Tg, Tl);
	       Tb = VADD(T5, Ta);
	       Tm = VADD(Tg, Tl);
	       Tt = VADD(Tb, Tm);
	       T1j = VADD(TG, TH);
	       T1k = VADD(TK, TL);
	       T1l = VADD(T1j, T1k);
	       TI = VFNMS(LDK(KP500000000), TH, TG);
	       TM = VFNMS(LDK(KP500000000), TL, TK);
	       TR = VADD(TI, TM);
	       Tz = VFNMS(LDK(KP500000000), Ty, Tx);
	       TD = VFNMS(LDK(KP500000000), TC, TB);
	       TQ = VADD(Tz, TD);
	       T1g = VADD(Tx, Ty);
	       T1h = VADD(TB, TC);
	       T1i = VADD(T1g, T1h);
	  }
	  {
	       V T1o, T1m, T1n, T1s, T1t, T1q, T1r, T1u, T1p;
	       T1o = VMUL(LDK(KP559016994), VSUB(T1i, T1l));
	       T1m = VADD(T1i, T1l);
	       T1n = VFNMS(LDK(KP250000000), T1m, T1f);
	       T1q = VSUB(T1g, T1h);
	       T1r = VSUB(T1j, T1k);
	       T1s = VBYI(VFNMS(LDK(KP951056516), T1r, VMUL(LDK(KP587785252), T1q)));
	       T1t = VBYI(VFMA(LDK(KP951056516), T1q, VMUL(LDK(KP587785252), T1r)));
	       ST(&(x[0]), VADD(T1f, T1m), dist, &(x[0]));
	       T1u = VADD(T1o, T1n);
	       ST(&(x[WS(ios, 6)]), VADD(T1t, T1u), dist, &(x[0]));
	       ST(&(x[WS(ios, 9)]), VSUB(T1u, T1t), dist, &(x[WS(ios, 1)]));
	       T1p = VSUB(T1n, T1o);
	       ST(&(x[WS(ios, 3)]), VSUB(T1p, T1s), dist, &(x[WS(ios, 1)]));
	       ST(&(x[WS(ios, 12)]), VADD(T1s, T1p), dist, &(x[0]));
	  }
	  {
	       V T11, T18, T1e, TO, T16, Tv, T15, TY, T1d, T19, TE, TN;
	       T11 = VFMA(LDK(KP823639103), TZ, VMUL(LDK(KP509036960), T10));
	       T18 = VFNMS(LDK(KP823639103), T10, VMUL(LDK(KP509036960), TZ));
	       T1e = VBYI(VMUL(LDK(KP866025403), VADD(Ts, Tt)));
	       TE = VSUB(Tz, TD);
	       TN = VSUB(TI, TM);
	       TO = VFMA(LDK(KP951056516), TE, VMUL(LDK(KP587785252), TN));
	       T16 = VFNMS(LDK(KP951056516), TN, VMUL(LDK(KP587785252), TE));
	       {
		    V Tn, Tu, TS, TW, TX;
		    Tn = VMUL(LDK(KP484122918), VSUB(Tb, Tm));
		    Tu = VFNMS(LDK(KP216506350), Tt, VMUL(LDK(KP866025403), Ts));
		    Tv = VADD(Tn, Tu);
		    T15 = VSUB(Tn, Tu);
		    TS = VMUL(LDK(KP559016994), VSUB(TQ, TR));
		    TW = VADD(TQ, TR);
		    TX = VFNMS(LDK(KP250000000), TW, TV);
		    TY = VADD(TS, TX);
		    T1d = VADD(TV, TW);
		    T19 = VSUB(TX, TS);
	       }
	       {
		    V TP, T12, T1b, T1c;
		    ST(&(x[WS(ios, 5)]), VSUB(T1d, T1e), dist, &(x[WS(ios, 1)]));
		    ST(&(x[WS(ios, 10)]), VADD(T1e, T1d), dist, &(x[0]));
		    TP = VBYI(VADD(Tv, TO));
		    T12 = VSUB(TY, T11);
		    ST(&(x[WS(ios, 1)]), VADD(TP, T12), dist, &(x[WS(ios, 1)]));
		    ST(&(x[WS(ios, 14)]), VSUB(T12, TP), dist, &(x[0]));
		    T1b = VBYI(VSUB(T16, T15));
		    T1c = VSUB(T19, T18);
		    ST(&(x[WS(ios, 7)]), VADD(T1b, T1c), dist, &(x[WS(ios, 1)]));
		    ST(&(x[WS(ios, 8)]), VSUB(T1c, T1b), dist, &(x[0]));
		    {
			 V T17, T1a, T13, T14;
			 T17 = VBYI(VADD(T15, T16));
			 T1a = VADD(T18, T19);
			 ST(&(x[WS(ios, 2)]), VADD(T17, T1a), dist, &(x[0]));
			 ST(&(x[WS(ios, 13)]), VSUB(T1a, T17), dist, &(x[WS(ios, 1)]));
			 T13 = VBYI(VSUB(Tv, TO));
			 T14 = VADD(T11, TY);
			 ST(&(x[WS(ios, 4)]), VADD(T13, T14), dist, &(x[0]));
			 ST(&(x[WS(ios, 11)]), VSUB(T14, T13), dist, &(x[WS(ios, 1)]));
		    }
	       }
	  }
     }
     END_SIMD();
     return W;
}

static const tw_instr twinstr[] = {
     VTW(1),
     VTW(2),
     VTW(3),
     VTW(4),
     VTW(5),
     VTW(6),
     VTW(7),
     VTW(8),
     VTW(9),
     VTW(10),
     VTW(11),
     VTW(12),
     VTW(13),
     VTW(14),
     {TW_NEXT, VL, 0}
};

static const ct_desc desc = { 15, "t1bv_15", twinstr, {78, 39, 14, 0}, &GENUS, 0, 0, 0 };

void X(codelet_t1bv_15) (planner *p) {
     X(kdft_dit_register) (p, t1bv_15, &desc);
}
