/*
 * Copyright (c) 2003, 2007-14 Matteo Frigo
 * Copyright (c) 2003, 2007-14 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

/* This file was automatically generated --- DO NOT EDIT */
/* Generated on Tue Sep 14 10:46:10 EDT 2021 */

#include "rdft/codelet-rdft.h"

#if defined(ARCH_PREFERS_FMA) || defined(ISA_EXTENSION_PREFERS_FMA)

/* Generated by: ../../../genfft/gen_r2cf.native -fma -compact -variables 4 -pipeline-latency 4 -n 10 -name r2cf_10 -include rdft/scalar/r2cf.h */

/*
 * This function contains 34 FP additions, 14 FP multiplications,
 * (or, 24 additions, 4 multiplications, 10 fused multiply/add),
 * 26 stack variables, 4 constants, and 20 memory accesses
 */
#include "rdft/scalar/r2cf.h"

static void r2cf_10(R *R0, R *R1, R *Cr, R *Ci, stride rs, stride csr, stride csi, INT v, INT ivs, INT ovs)
{
     DK(KP559016994, +0.559016994374947424102293417182819058860154590);
     DK(KP250000000, +0.250000000000000000000000000000000000000000000);
     DK(KP618033988, +0.618033988749894848204586834365638117720309180);
     DK(KP951056516, +0.951056516295153572116439333379382143405698634);
     {
	  INT i;
	  for (i = v; i > 0; i = i - 1, R0 = R0 + ivs, R1 = R1 + ivs, Cr = Cr + ovs, Ci = Ci + ovs, MAKE_VOLATILE_STRIDE(40, rs), MAKE_VOLATILE_STRIDE(40, csr), MAKE_VOLATILE_STRIDE(40, csi)) {
	       E T3, Tt, Td, Tn, Tg, To, Th, Tv, T6, Tq, T9, Tr, Ta, Tu, T1;
	       E T2;
	       T1 = R0[0];
	       T2 = R1[WS(rs, 2)];
	       T3 = T1 - T2;
	       Tt = T1 + T2;
	       {
		    E Tb, Tc, Te, Tf;
		    Tb = R0[WS(rs, 2)];
		    Tc = R1[WS(rs, 4)];
		    Td = Tb - Tc;
		    Tn = Tb + Tc;
		    Te = R0[WS(rs, 3)];
		    Tf = R1[0];
		    Tg = Te - Tf;
		    To = Te + Tf;
	       }
	       Th = Td + Tg;
	       Tv = Tn + To;
	       {
		    E T4, T5, T7, T8;
		    T4 = R0[WS(rs, 1)];
		    T5 = R1[WS(rs, 3)];
		    T6 = T4 - T5;
		    Tq = T4 + T5;
		    T7 = R0[WS(rs, 4)];
		    T8 = R1[WS(rs, 1)];
		    T9 = T7 - T8;
		    Tr = T7 + T8;
	       }
	       Ta = T6 + T9;
	       Tu = Tq + Tr;
	       {
		    E Tl, Tm, Tk, Ti, Tj;
		    Tl = T6 - T9;
		    Tm = Tg - Td;
		    Ci[WS(csi, 1)] = -(KP951056516 * (FNMS(KP618033988, Tm, Tl)));
		    Ci[WS(csi, 3)] = KP951056516 * (FMA(KP618033988, Tl, Tm));
		    Tk = Ta - Th;
		    Ti = Ta + Th;
		    Tj = FNMS(KP250000000, Ti, T3);
		    Cr[WS(csr, 1)] = FMA(KP559016994, Tk, Tj);
		    Cr[WS(csr, 5)] = T3 + Ti;
		    Cr[WS(csr, 3)] = FNMS(KP559016994, Tk, Tj);
	       }
	       {
		    E Tp, Ts, Ty, Tw, Tx;
		    Tp = Tn - To;
		    Ts = Tq - Tr;
		    Ci[WS(csi, 2)] = KP951056516 * (FNMS(KP618033988, Ts, Tp));
		    Ci[WS(csi, 4)] = KP951056516 * (FMA(KP618033988, Tp, Ts));
		    Ty = Tu - Tv;
		    Tw = Tu + Tv;
		    Tx = FNMS(KP250000000, Tw, Tt);
		    Cr[WS(csr, 2)] = FNMS(KP559016994, Ty, Tx);
		    Cr[0] = Tt + Tw;
		    Cr[WS(csr, 4)] = FMA(KP559016994, Ty, Tx);
	       }
	  }
     }
}

static const kr2c_desc desc = { 10, "r2cf_10", { 24, 4, 10, 0 }, &GENUS };

void X(codelet_r2cf_10) (planner *p) { X(kr2c_register) (p, r2cf_10, &desc);
}

#else

/* Generated by: ../../../genfft/gen_r2cf.native -compact -variables 4 -pipeline-latency 4 -n 10 -name r2cf_10 -include rdft/scalar/r2cf.h */

/*
 * This function contains 34 FP additions, 12 FP multiplications,
 * (or, 28 additions, 6 multiplications, 6 fused multiply/add),
 * 26 stack variables, 4 constants, and 20 memory accesses
 */
#include "rdft/scalar/r2cf.h"

static void r2cf_10(R *R0, R *R1, R *Cr, R *Ci, stride rs, stride csr, stride csi, INT v, INT ivs, INT ovs)
{
     DK(KP250000000, +0.250000000000000000000000000000000000000000000);
     DK(KP559016994, +0.559016994374947424102293417182819058860154590);
     DK(KP951056516, +0.951056516295153572116439333379382143405698634);
     DK(KP587785252, +0.587785252292473129168705954639072768597652438);
     {
	  INT i;
	  for (i = v; i > 0; i = i - 1, R0 = R0 + ivs, R1 = R1 + ivs, Cr = Cr + ovs, Ci = Ci + ovs, MAKE_VOLATILE_STRIDE(40, rs), MAKE_VOLATILE_STRIDE(40, csr), MAKE_VOLATILE_STRIDE(40, csi)) {
	       E Ti, Tt, Ta, Tn, Td, To, Te, Tv, T3, Tq, T6, Tr, T7, Tu, Tg;
	       E Th;
	       Tg = R0[0];
	       Th = R1[WS(rs, 2)];
	       Ti = Tg - Th;
	       Tt = Tg + Th;
	       {
		    E T8, T9, Tb, Tc;
		    T8 = R0[WS(rs, 2)];
		    T9 = R1[WS(rs, 4)];
		    Ta = T8 - T9;
		    Tn = T8 + T9;
		    Tb = R0[WS(rs, 3)];
		    Tc = R1[0];
		    Td = Tb - Tc;
		    To = Tb + Tc;
	       }
	       Te = Ta + Td;
	       Tv = Tn + To;
	       {
		    E T1, T2, T4, T5;
		    T1 = R0[WS(rs, 1)];
		    T2 = R1[WS(rs, 3)];
		    T3 = T1 - T2;
		    Tq = T1 + T2;
		    T4 = R0[WS(rs, 4)];
		    T5 = R1[WS(rs, 1)];
		    T6 = T4 - T5;
		    Tr = T4 + T5;
	       }
	       T7 = T3 + T6;
	       Tu = Tq + Tr;
	       {
		    E Tl, Tm, Tf, Tj, Tk;
		    Tl = Td - Ta;
		    Tm = T3 - T6;
		    Ci[WS(csi, 1)] = FNMS(KP951056516, Tm, KP587785252 * Tl);
		    Ci[WS(csi, 3)] = FMA(KP587785252, Tm, KP951056516 * Tl);
		    Tf = KP559016994 * (T7 - Te);
		    Tj = T7 + Te;
		    Tk = FNMS(KP250000000, Tj, Ti);
		    Cr[WS(csr, 1)] = Tf + Tk;
		    Cr[WS(csr, 5)] = Ti + Tj;
		    Cr[WS(csr, 3)] = Tk - Tf;
	       }
	       {
		    E Tp, Ts, Ty, Tw, Tx;
		    Tp = Tn - To;
		    Ts = Tq - Tr;
		    Ci[WS(csi, 2)] = FNMS(KP587785252, Ts, KP951056516 * Tp);
		    Ci[WS(csi, 4)] = FMA(KP951056516, Ts, KP587785252 * Tp);
		    Ty = KP559016994 * (Tu - Tv);
		    Tw = Tu + Tv;
		    Tx = FNMS(KP250000000, Tw, Tt);
		    Cr[WS(csr, 2)] = Tx - Ty;
		    Cr[0] = Tt + Tw;
		    Cr[WS(csr, 4)] = Ty + Tx;
	       }
	  }
     }
}

static const kr2c_desc desc = { 10, "r2cf_10", { 28, 6, 6, 0 }, &GENUS };

void X(codelet_r2cf_10) (planner *p) { X(kr2c_register) (p, r2cf_10, &desc);
}

#endif
