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

#include "codelet-dft.h"

/* Generated by: /homee/stevenj/cvs/fftw3.0.1/genfft/gen_twidsq -compact -variables 4 -reload-twiddle -dif -n 4 -name q1_4 -include q.h */

/*
 * This function contains 88 FP additions, 48 FP multiplications,
 * (or, 64 additions, 24 multiplications, 24 fused multiply/add),
 * 37 stack variables, and 64 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_twidsq.ml,v 1.14 2003/03/15 20:29:42 stevenj Exp $
 */

#include "q.h"

static const R *q1_4(R *rio, R *iio, const R *W, stride is, stride vs, int m, int dist)
{
     int i;
     for (i = m; i > 0; i = i - 1, rio = rio + dist, iio = iio + dist, W = W + 6) {
	  E T3, Te, Tb, Tq, T6, T8, Th, Tr, Tv, TG, TD, TS, Ty, TA, TJ;
	  E TT, TX, T18, T15, T1k, T10, T12, T1b, T1l, T1p, T1A, T1x, T1M, T1s, T1u;
	  E T1D, T1N;
	  {
	       E T1, T2, T9, Ta;
	       T1 = rio[0];
	       T2 = rio[WS(is, 2)];
	       T3 = T1 + T2;
	       Te = T1 - T2;
	       T9 = iio[0];
	       Ta = iio[WS(is, 2)];
	       Tb = T9 - Ta;
	       Tq = T9 + Ta;
	  }
	  {
	       E T4, T5, Tf, Tg;
	       T4 = rio[WS(is, 1)];
	       T5 = rio[WS(is, 3)];
	       T6 = T4 + T5;
	       T8 = T4 - T5;
	       Tf = iio[WS(is, 1)];
	       Tg = iio[WS(is, 3)];
	       Th = Tf - Tg;
	       Tr = Tf + Tg;
	  }
	  {
	       E Tt, Tu, TB, TC;
	       Tt = rio[WS(vs, 1)];
	       Tu = rio[WS(vs, 1) + WS(is, 2)];
	       Tv = Tt + Tu;
	       TG = Tt - Tu;
	       TB = iio[WS(vs, 1)];
	       TC = iio[WS(vs, 1) + WS(is, 2)];
	       TD = TB - TC;
	       TS = TB + TC;
	  }
	  {
	       E Tw, Tx, TH, TI;
	       Tw = rio[WS(vs, 1) + WS(is, 1)];
	       Tx = rio[WS(vs, 1) + WS(is, 3)];
	       Ty = Tw + Tx;
	       TA = Tw - Tx;
	       TH = iio[WS(vs, 1) + WS(is, 1)];
	       TI = iio[WS(vs, 1) + WS(is, 3)];
	       TJ = TH - TI;
	       TT = TH + TI;
	  }
	  {
	       E TV, TW, T13, T14;
	       TV = rio[WS(vs, 2)];
	       TW = rio[WS(vs, 2) + WS(is, 2)];
	       TX = TV + TW;
	       T18 = TV - TW;
	       T13 = iio[WS(vs, 2)];
	       T14 = iio[WS(vs, 2) + WS(is, 2)];
	       T15 = T13 - T14;
	       T1k = T13 + T14;
	  }
	  {
	       E TY, TZ, T19, T1a;
	       TY = rio[WS(vs, 2) + WS(is, 1)];
	       TZ = rio[WS(vs, 2) + WS(is, 3)];
	       T10 = TY + TZ;
	       T12 = TY - TZ;
	       T19 = iio[WS(vs, 2) + WS(is, 1)];
	       T1a = iio[WS(vs, 2) + WS(is, 3)];
	       T1b = T19 - T1a;
	       T1l = T19 + T1a;
	  }
	  {
	       E T1n, T1o, T1v, T1w;
	       T1n = rio[WS(vs, 3)];
	       T1o = rio[WS(vs, 3) + WS(is, 2)];
	       T1p = T1n + T1o;
	       T1A = T1n - T1o;
	       T1v = iio[WS(vs, 3)];
	       T1w = iio[WS(vs, 3) + WS(is, 2)];
	       T1x = T1v - T1w;
	       T1M = T1v + T1w;
	  }
	  {
	       E T1q, T1r, T1B, T1C;
	       T1q = rio[WS(vs, 3) + WS(is, 1)];
	       T1r = rio[WS(vs, 3) + WS(is, 3)];
	       T1s = T1q + T1r;
	       T1u = T1q - T1r;
	       T1B = iio[WS(vs, 3) + WS(is, 1)];
	       T1C = iio[WS(vs, 3) + WS(is, 3)];
	       T1D = T1B - T1C;
	       T1N = T1B + T1C;
	  }
	  rio[0] = T3 + T6;
	  iio[0] = Tq + Tr;
	  rio[WS(is, 1)] = Tv + Ty;
	  iio[WS(is, 1)] = TS + TT;
	  rio[WS(is, 2)] = TX + T10;
	  iio[WS(is, 2)] = T1k + T1l;
	  iio[WS(is, 3)] = T1M + T1N;
	  rio[WS(is, 3)] = T1p + T1s;
	  {
	       E Tc, Ti, T7, Td;
	       Tc = T8 + Tb;
	       Ti = Te - Th;
	       T7 = W[4];
	       Td = W[5];
	       iio[WS(vs, 3)] = FNMS(Td, Ti, T7 * Tc);
	       rio[WS(vs, 3)] = FMA(Td, Tc, T7 * Ti);
	  }
	  {
	       E T1K, T1O, T1J, T1L;
	       T1K = T1p - T1s;
	       T1O = T1M - T1N;
	       T1J = W[2];
	       T1L = W[3];
	       rio[WS(vs, 2) + WS(is, 3)] = FMA(T1J, T1K, T1L * T1O);
	       iio[WS(vs, 2) + WS(is, 3)] = FNMS(T1L, T1K, T1J * T1O);
	  }
	  {
	       E Tk, Tm, Tj, Tl;
	       Tk = Tb - T8;
	       Tm = Te + Th;
	       Tj = W[0];
	       Tl = W[1];
	       iio[WS(vs, 1)] = FNMS(Tl, Tm, Tj * Tk);
	       rio[WS(vs, 1)] = FMA(Tl, Tk, Tj * Tm);
	  }
	  {
	       E To, Ts, Tn, Tp;
	       To = T3 - T6;
	       Ts = Tq - Tr;
	       Tn = W[2];
	       Tp = W[3];
	       rio[WS(vs, 2)] = FMA(Tn, To, Tp * Ts);
	       iio[WS(vs, 2)] = FNMS(Tp, To, Tn * Ts);
	  }
	  {
	       E T16, T1c, T11, T17;
	       T16 = T12 + T15;
	       T1c = T18 - T1b;
	       T11 = W[4];
	       T17 = W[5];
	       iio[WS(vs, 3) + WS(is, 2)] = FNMS(T17, T1c, T11 * T16);
	       rio[WS(vs, 3) + WS(is, 2)] = FMA(T17, T16, T11 * T1c);
	  }
	  {
	       E T1G, T1I, T1F, T1H;
	       T1G = T1x - T1u;
	       T1I = T1A + T1D;
	       T1F = W[0];
	       T1H = W[1];
	       iio[WS(vs, 1) + WS(is, 3)] = FNMS(T1H, T1I, T1F * T1G);
	       rio[WS(vs, 1) + WS(is, 3)] = FMA(T1H, T1G, T1F * T1I);
	  }
	  {
	       E TQ, TU, TP, TR;
	       TQ = Tv - Ty;
	       TU = TS - TT;
	       TP = W[2];
	       TR = W[3];
	       rio[WS(vs, 2) + WS(is, 1)] = FMA(TP, TQ, TR * TU);
	       iio[WS(vs, 2) + WS(is, 1)] = FNMS(TR, TQ, TP * TU);
	  }
	  {
	       E T1e, T1g, T1d, T1f;
	       T1e = T15 - T12;
	       T1g = T18 + T1b;
	       T1d = W[0];
	       T1f = W[1];
	       iio[WS(vs, 1) + WS(is, 2)] = FNMS(T1f, T1g, T1d * T1e);
	       rio[WS(vs, 1) + WS(is, 2)] = FMA(T1f, T1e, T1d * T1g);
	  }
	  {
	       E T1i, T1m, T1h, T1j;
	       T1i = TX - T10;
	       T1m = T1k - T1l;
	       T1h = W[2];
	       T1j = W[3];
	       rio[WS(vs, 2) + WS(is, 2)] = FMA(T1h, T1i, T1j * T1m);
	       iio[WS(vs, 2) + WS(is, 2)] = FNMS(T1j, T1i, T1h * T1m);
	  }
	  {
	       E T1y, T1E, T1t, T1z;
	       T1y = T1u + T1x;
	       T1E = T1A - T1D;
	       T1t = W[4];
	       T1z = W[5];
	       iio[WS(vs, 3) + WS(is, 3)] = FNMS(T1z, T1E, T1t * T1y);
	       rio[WS(vs, 3) + WS(is, 3)] = FMA(T1z, T1y, T1t * T1E);
	  }
	  {
	       E TM, TO, TL, TN;
	       TM = TD - TA;
	       TO = TG + TJ;
	       TL = W[0];
	       TN = W[1];
	       iio[WS(vs, 1) + WS(is, 1)] = FNMS(TN, TO, TL * TM);
	       rio[WS(vs, 1) + WS(is, 1)] = FMA(TN, TM, TL * TO);
	  }
	  {
	       E TE, TK, Tz, TF;
	       TE = TA + TD;
	       TK = TG - TJ;
	       Tz = W[4];
	       TF = W[5];
	       iio[WS(vs, 3) + WS(is, 1)] = FNMS(TF, TK, Tz * TE);
	       rio[WS(vs, 3) + WS(is, 1)] = FMA(TF, TE, Tz * TK);
	  }
     }
     return W;
}

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

static const ct_desc desc = { 4, "q1_4", twinstr, {64, 24, 24, 0}, &GENUS, 0, 0, 0 };

void X(codelet_q1_4) (planner *p) {
     X(kdft_difsq_register) (p, q1_4, &desc);
}
