/*
 * 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 22:11:25 EDT 2003 */

#include "codelet-rdft.h"

/* Generated by: /homee/stevenj/cvs/fftw3.0.1/genfft/gen_hc2hc -compact -variables 4 -sign 1 -n 6 -dif -name hb_6 -include hb.h */

/*
 * This function contains 46 FP additions, 28 FP multiplications,
 * (or, 32 additions, 14 multiplications, 14 fused multiply/add),
 * 25 stack variables, and 24 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_hc2hc.ml,v 1.9 2003/04/17 19:25:50 athena Exp $
 */

#include "hb.h"

static const R *hb_6(R *rio, R *iio, const R *W, stride ios, int m, int dist)
{
     DK(KP500000000, +0.500000000000000000000000000000000000000000000);
     DK(KP866025403, +0.866025403784438646763723170752936183471402627);
     int i;
     for (i = m - 2; i > 0; i = i - 2, rio = rio + dist, iio = iio - dist, W = W + 10) {
	  E T3, Ty, Tp, TE, Ta, TO, Tm, TB, Tj, TL, Tq, TH;
	  {
	       E T1, T2, Tn, To;
	       T1 = rio[0];
	       T2 = iio[-WS(ios, 3)];
	       T3 = T1 + T2;
	       Ty = T1 - T2;
	       Tn = iio[0];
	       To = rio[WS(ios, 3)];
	       Tp = Tn - To;
	       TE = Tn + To;
	  }
	  {
	       E T6, Tz, T9, TA;
	       {
		    E T4, T5, T7, T8;
		    T4 = rio[WS(ios, 2)];
		    T5 = iio[-WS(ios, 5)];
		    T6 = T4 + T5;
		    Tz = T4 - T5;
		    T7 = iio[-WS(ios, 4)];
		    T8 = rio[WS(ios, 1)];
		    T9 = T7 + T8;
		    TA = T7 - T8;
	       }
	       Ta = T6 + T9;
	       TO = KP866025403 * (Tz - TA);
	       Tm = KP866025403 * (T6 - T9);
	       TB = Tz + TA;
	  }
	  {
	       E Tf, TF, Ti, TG;
	       {
		    E Td, Te, Tg, Th;
		    Td = iio[-WS(ios, 1)];
		    Te = rio[WS(ios, 4)];
		    Tf = Td - Te;
		    TF = Te + Td;
		    Tg = iio[-WS(ios, 2)];
		    Th = rio[WS(ios, 5)];
		    Ti = Tg - Th;
		    TG = Tg + Th;
	       }
	       Tj = KP866025403 * (Tf - Ti);
	       TL = KP866025403 * (TF + TG);
	       Tq = Tf + Ti;
	       TH = TF - TG;
	  }
	  rio[0] = T3 + Ta;
	  iio[-WS(ios, 5)] = Tp + Tq;
	  {
	       E TC, TI, Tx, TD;
	       TC = Ty + TB;
	       TI = TE - TH;
	       Tx = W[4];
	       TD = W[5];
	       rio[WS(ios, 3)] = FNMS(TD, TI, Tx * TC);
	       iio[-WS(ios, 2)] = FMA(TD, TC, Tx * TI);
	  }
	  {
	       E Tk, Tu, Ts, Tw, Tc, Tr;
	       Tc = FNMS(KP500000000, Ta, T3);
	       Tk = Tc + Tj;
	       Tu = Tc - Tj;
	       Tr = FNMS(KP500000000, Tq, Tp);
	       Ts = Tm + Tr;
	       Tw = Tr - Tm;
	       {
		    E Tb, Tl, Tt, Tv;
		    Tb = W[6];
		    Tl = W[7];
		    rio[WS(ios, 4)] = FNMS(Tl, Ts, Tb * Tk);
		    iio[-WS(ios, 1)] = FMA(Tl, Tk, Tb * Ts);
		    Tt = W[2];
		    Tv = W[3];
		    rio[WS(ios, 2)] = FNMS(Tv, Tw, Tt * Tu);
		    iio[-WS(ios, 3)] = FMA(Tv, Tu, Tt * Tw);
	       }
	  }
	  {
	       E TM, TU, TQ, TS, TK, TP;
	       TK = FNMS(KP500000000, TB, Ty);
	       TM = TK - TL;
	       TU = TK + TL;
	       TP = FMA(KP500000000, TH, TE);
	       TQ = TO + TP;
	       TS = TP - TO;
	       {
		    E TJ, TN, TR, TT;
		    TJ = W[0];
		    TN = W[1];
		    rio[WS(ios, 1)] = FNMS(TN, TQ, TJ * TM);
		    iio[-WS(ios, 4)] = FMA(TJ, TQ, TN * TM);
		    TR = W[8];
		    TT = W[9];
		    iio[0] = FMA(TR, TS, TT * TU);
		    rio[WS(ios, 5)] = FNMS(TT, TS, TR * TU);
	       }
	  }
     }
     return W;
}

static const tw_instr twinstr[] = {
     {TW_FULL, 0, 6},
     {TW_NEXT, 1, 0}
};

static const hc2hc_desc desc = { 6, "hb_6", twinstr, {32, 14, 14, 0}, &GENUS, 0, 0, 0 };

void X(codelet_hb_6) (planner *p) {
     X(khc2hc_dif_register) (p, hb_6, &desc);
}
