/*
 * Copyright (c) 1997-1999 Massachusetts Institute of Technology
 * Copyright (c) 2000-2002 Stefan Kral
 *
 * 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 Tue Feb 19 15:27:58 CET 2002 */

#include <fftw-int.h>
#include <fftw.h>



DECLARE_SIMD_CONST2 (PK1_000000000NK1_000000000, +1.0000000000000000000000000,
		     -1.0000000000000000000000000);
DECLARE_SIMD_CONST2 (PK250000000PK250000000, +0.2500000000000000000000000,
		     +0.2500000000000000000000000);
DECLARE_SIMD_CONST2 (PK559016994PK559016994, +0.5590169943749474241022934,
		     +0.5590169943749474241022934);
DECLARE_SIMD_CONST2 (PK1_618033988PK1_618033988, +1.6180339887498948482045868,
		     +1.6180339887498948482045868);
DECLARE_SIMD_CONST2 (PK587785252PK587785252, +0.5877852522924731291687060,
		     +0.5877852522924731291687060);

void
fftwi_twiddle_5 (fftw_complex * ioC, const fftw_complex * twC, int iostride,
		 int m, int dist)
{
     fftw_simd2 *inout = (fftw_simd2 *) ioC;
     const fftw_simd2 *W = (const fftw_simd2 *) twC;

     for (; m > 0; m--, inout += dist, W += 4)
       {
	    DECLARE_SIMD_TMPVAR2 (t1181);
	    DECLARE_SIMD_TMPVAR2 (t1182);
	    DECLARE_SIMD_TMPVAR2 (t1180);
	    DECLARE_SIMD_TMPVAR2 (t1178);
	    DECLARE_SIMD_TMPVAR2 (t1179);
	    DECLARE_SIMD_TMPVAR2 (t1195);
	    DECLARE_SIMD_TMPVAR2 (t1196);
	    DECLARE_SIMD_TMPVAR2 (t1194);
	    DECLARE_SIMD_TMPVAR2 (t1192);
	    DECLARE_SIMD_TMPVAR2 (t1193);
	    DECLARE_SIMD_TMPVAR2 (t1228);
	    DECLARE_SIMD_TMPVAR2 (t1227);
	    DECLARE_SIMD_TMPVAR2 (t1167);
	    DECLARE_SIMD_TMPVAR2 (t1230);
	    DECLARE_SIMD_TMPVAR2 (t1229);
	    DECLARE_SIMD_TMPVAR2 (t1168);
	    DECLARE_SIMD_TMPVAR2 (t1136);
	    DECLARE_SIMD_TMPVAR2 (t1212);
	    DECLARE_SIMD_TMPVAR2 (t1151);
	    DECLARE_SIMD_TMPVAR2 (t1152);
	    DECLARE_SIMD_TMPVAR2 (t1150);
	    DECLARE_SIMD_TMPVAR2 (t1148);
	    DECLARE_SIMD_TMPVAR2 (t1149);
	    DECLARE_SIMD_TMPVAR2 (t1165);
	    DECLARE_SIMD_TMPVAR2 (t1166);
	    DECLARE_SIMD_TMPVAR2 (t1164);
	    DECLARE_SIMD_TMPVAR2 (t1162);
	    DECLARE_SIMD_TMPVAR2 (t1163);
	    DECLARE_SIMD_TMPVAR2 (t1224);
	    DECLARE_SIMD_TMPVAR2 (t1223);
	    DECLARE_SIMD_TMPVAR2 (t1137);
	    DECLARE_SIMD_TMPVAR2 (t1226);
	    DECLARE_SIMD_TMPVAR2 (t1225);
	    DECLARE_SIMD_TMPVAR2 (t1138);
	    DECLARE_SIMD_TMPVAR2 (t1135);
	    DECLARE_SIMD_TMPVAR2 (t1209);
	    DECLARE_SIMD_TMPVAR2 (t1204);
	    DECLARE_SIMD_TMPVAR2 (t1134);
	    DECLARE_SIMD_TMPVAR2 (t1133);
	    DECLARE_SIMD_TMPVAR2 (t1201);
	    DECLARE_SIMD_TMPVAR2 (t1132);
	    DECLARE_SIMD_TMPVAR2 (t1198);
	    DECLARE_SIMD_TMPVAR2 (t1216);
	    DECLARE_SIMD_TMPVAR2 (t1241);
	    DECLARE_SIMD_TMPVAR2 (t1242);
	    DECLARE_SIMD_TMPVAR2 (t1240);
	    DECLARE_SIMD_TMPVAR2 (t1197);
	    DECLARE_SIMD_TMPVAR2 (t1213);
	    DECLARE_SIMD_TMPVAR2 (t1231);
	    DECLARE_SIMD_TMPVAR2 (t1221);
	    DECLARE_SIMD_TMPVAR2 (t1215);

	    simd_ld2 (inout[iostride * 2], t1181);
	    simd_swap2 (t1181, t1182);
	    simd_ld2 (W[1], t1180);
	    simd_mul2 (t1180, t1181, t1178);
	    simd_mul2 (t1180, t1182, t1179);
	    simd_ld2 (inout[iostride * 3], t1195);
	    simd_swap2 (t1195, t1196);
	    simd_ld2 (W[2], t1194);
	    simd_mul2 (t1194, t1195, t1192);
	    simd_mul2 (t1194, t1196, t1193);
	    simd_unpckL2 (t1178, t1179, t1228);
	    simd_unpckH2 (t1178, t1179, t1227);
	    simd_fmca2 (PK1_000000000NK1_000000000, t1227, t1228, t1167);
	    simd_unpckL2 (t1192, t1193, t1230);
	    simd_unpckH2 (t1192, t1193, t1229);
	    simd_fmca2 (PK1_000000000NK1_000000000, t1229, t1230, t1168);
	    simd_add2 (t1167, t1168, t1136);
	    simd_sub2 (t1167, t1168, t1212);
	    simd_ld2 (inout[iostride], t1151);
	    simd_swap2 (t1151, t1152);
	    simd_ld2 (W[0], t1150);
	    simd_mul2 (t1150, t1151, t1148);
	    simd_mul2 (t1150, t1152, t1149);
	    simd_ld2 (inout[iostride * 4], t1165);
	    simd_swap2 (t1165, t1166);
	    simd_ld2 (W[3], t1164);
	    simd_mul2 (t1164, t1165, t1162);
	    simd_mul2 (t1164, t1166, t1163);
	    simd_unpckL2 (t1148, t1149, t1224);
	    simd_unpckH2 (t1148, t1149, t1223);
	    simd_fmca2 (PK1_000000000NK1_000000000, t1223, t1224, t1137);
	    simd_unpckL2 (t1162, t1163, t1226);
	    simd_unpckH2 (t1162, t1163, t1225);
	    simd_fmca2 (PK1_000000000NK1_000000000, t1225, t1226, t1138);
	    simd_add2 (t1137, t1138, t1135);
	    simd_sub2 (t1137, t1138, t1209);
	    simd_sub2 (t1135, t1136, t1204);
	    simd_add2 (t1135, t1136, t1134);
	    simd_ld2 (inout[0], t1133);
	    simd_fnmca2 (PK250000000PK250000000, t1134, t1133, t1201);
	    simd_add2 (t1133, t1134, t1132);
	    simd_st2 (t1132, inout[0]);
	    simd_fnmca2 (PK559016994PK559016994, t1204, t1201, t1198);
	    simd_fmca2 (PK559016994PK559016994, t1204, t1201, t1216);
	    simd_fmca2 (PK1_618033988PK1_618033988, t1209, t1212, t1241);
	    simd_fnmca2 (PK1_618033988PK1_618033988, t1212, t1209, t1242);
	    simd_swapchsH2 (t1242, t1240);
	    simd_fnmca2 (PK587785252PK587785252, t1240, t1198, t1197);
	    simd_fmca2 (PK587785252PK587785252, t1240, t1198, t1213);
	    simd_st2 (t1197, inout[iostride * 2]);
	    simd_st2 (t1213, inout[iostride * 3]);
	    simd_swapchsH2 (t1241, t1231);
	    simd_fmca2 (PK587785252PK587785252, t1231, t1216, t1221);
	    simd_fnmca2 (PK587785252PK587785252, t1231, t1216, t1215);
	    simd_st2 (t1221, inout[iostride * 4]);
	    simd_st2 (t1215, inout[iostride]);
       }
}


static const int twiddle_order[] = { 1, 2, 3, 4 };

fftw_codelet_desc fftwi_twiddle_5_desc = {
     "fftwi_twiddle_5",
     (void (*)()) fftwi_twiddle_5,
     5,
     FFTW_BACKWARD,
     FFTW_TWIDDLE,
     121,
     4,
     twiddle_order,
};
