/*
 * 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:11:14 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 (PK618033988PK618033988, +0.6180339887498948482045868,
		     +0.6180339887498948482045868);
DECLARE_SIMD_CONST2 (PK587785252PK587785252, +0.5877852522924731291687060,
		     +0.5877852522924731291687060);
DECLARE_SIMD_CONST2 (PK951056516PK951056516, +0.9510565162951535721164393,
		     +0.9510565162951535721164393);

void
fftw_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 (t1115);
	    DECLARE_SIMD_TMPVAR2 (t1116);
	    DECLARE_SIMD_TMPVAR2 (t1114);
	    DECLARE_SIMD_TMPVAR2 (t1112);
	    DECLARE_SIMD_TMPVAR2 (t1113);
	    DECLARE_SIMD_TMPVAR2 (t1129);
	    DECLARE_SIMD_TMPVAR2 (t1130);
	    DECLARE_SIMD_TMPVAR2 (t1128);
	    DECLARE_SIMD_TMPVAR2 (t1126);
	    DECLARE_SIMD_TMPVAR2 (t1127);
	    DECLARE_SIMD_TMPVAR2 (t1162);
	    DECLARE_SIMD_TMPVAR2 (t1161);
	    DECLARE_SIMD_TMPVAR2 (t1101);
	    DECLARE_SIMD_TMPVAR2 (t1164);
	    DECLARE_SIMD_TMPVAR2 (t1163);
	    DECLARE_SIMD_TMPVAR2 (t1102);
	    DECLARE_SIMD_TMPVAR2 (t1070);
	    DECLARE_SIMD_TMPVAR2 (t1146);
	    DECLARE_SIMD_TMPVAR2 (t1085);
	    DECLARE_SIMD_TMPVAR2 (t1086);
	    DECLARE_SIMD_TMPVAR2 (t1084);
	    DECLARE_SIMD_TMPVAR2 (t1082);
	    DECLARE_SIMD_TMPVAR2 (t1083);
	    DECLARE_SIMD_TMPVAR2 (t1099);
	    DECLARE_SIMD_TMPVAR2 (t1100);
	    DECLARE_SIMD_TMPVAR2 (t1098);
	    DECLARE_SIMD_TMPVAR2 (t1096);
	    DECLARE_SIMD_TMPVAR2 (t1097);
	    DECLARE_SIMD_TMPVAR2 (t1158);
	    DECLARE_SIMD_TMPVAR2 (t1157);
	    DECLARE_SIMD_TMPVAR2 (t1071);
	    DECLARE_SIMD_TMPVAR2 (t1160);
	    DECLARE_SIMD_TMPVAR2 (t1159);
	    DECLARE_SIMD_TMPVAR2 (t1072);
	    DECLARE_SIMD_TMPVAR2 (t1069);
	    DECLARE_SIMD_TMPVAR2 (t1143);
	    DECLARE_SIMD_TMPVAR2 (t1137);
	    DECLARE_SIMD_TMPVAR2 (t1068);
	    DECLARE_SIMD_TMPVAR2 (t1067);
	    DECLARE_SIMD_TMPVAR2 (t1136);
	    DECLARE_SIMD_TMPVAR2 (t1066);
	    DECLARE_SIMD_TMPVAR2 (t1150);
	    DECLARE_SIMD_TMPVAR2 (t1132);
	    DECLARE_SIMD_TMPVAR2 (t1175);
	    DECLARE_SIMD_TMPVAR2 (t1176);
	    DECLARE_SIMD_TMPVAR2 (t1165);
	    DECLARE_SIMD_TMPVAR2 (t1131);
	    DECLARE_SIMD_TMPVAR2 (t1147);
	    DECLARE_SIMD_TMPVAR2 (t1174);
	    DECLARE_SIMD_TMPVAR2 (t1155);
	    DECLARE_SIMD_TMPVAR2 (t1149);

	    simd_ld2 (inout[iostride * 2], t1115);
	    simd_swap2 (t1115, t1116);
	    simd_ld2 (W[1], t1114);
	    simd_mul2 (t1114, t1115, t1112);
	    simd_mul2 (t1114, t1116, t1113);
	    simd_ld2 (inout[iostride * 3], t1129);
	    simd_swap2 (t1129, t1130);
	    simd_ld2 (W[2], t1128);
	    simd_mul2 (t1128, t1129, t1126);
	    simd_mul2 (t1128, t1130, t1127);
	    simd_unpckL2 (t1112, t1113, t1162);
	    simd_unpckH2 (t1112, t1113, t1161);
	    simd_fnmca2 (PK1_000000000NK1_000000000, t1161, t1162, t1101);
	    simd_unpckL2 (t1126, t1127, t1164);
	    simd_unpckH2 (t1126, t1127, t1163);
	    simd_fnmca2 (PK1_000000000NK1_000000000, t1163, t1164, t1102);
	    simd_add2 (t1101, t1102, t1070);
	    simd_sub2 (t1101, t1102, t1146);
	    simd_ld2 (inout[iostride], t1085);
	    simd_swap2 (t1085, t1086);
	    simd_ld2 (W[0], t1084);
	    simd_mul2 (t1084, t1085, t1082);
	    simd_mul2 (t1084, t1086, t1083);
	    simd_ld2 (inout[iostride * 4], t1099);
	    simd_swap2 (t1099, t1100);
	    simd_ld2 (W[3], t1098);
	    simd_mul2 (t1098, t1099, t1096);
	    simd_mul2 (t1098, t1100, t1097);
	    simd_unpckL2 (t1082, t1083, t1158);
	    simd_unpckH2 (t1082, t1083, t1157);
	    simd_fnmca2 (PK1_000000000NK1_000000000, t1157, t1158, t1071);
	    simd_unpckL2 (t1096, t1097, t1160);
	    simd_unpckH2 (t1096, t1097, t1159);
	    simd_fnmca2 (PK1_000000000NK1_000000000, t1159, t1160, t1072);
	    simd_add2 (t1071, t1072, t1069);
	    simd_sub2 (t1071, t1072, t1143);
	    simd_sub2 (t1069, t1070, t1137);
	    simd_add2 (t1069, t1070, t1068);
	    simd_ld2 (inout[0], t1067);
	    simd_fnmca2 (PK250000000PK250000000, t1068, t1067, t1136);
	    simd_add2 (t1067, t1068, t1066);
	    simd_st2 (t1066, inout[0]);
	    simd_fnmca2 (PK559016994PK559016994, t1137, t1136, t1150);
	    simd_fmca2 (PK559016994PK559016994, t1137, t1136, t1132);
	    simd_fmca2 (PK1_618033988PK1_618033988, t1143, t1146, t1175);
	    simd_fnmca2 (PK618033988PK618033988, t1143, t1146, t1176);
	    simd_swapchsH2 (t1175, t1165);
	    simd_fnmca2 (PK587785252PK587785252, t1165, t1132, t1131);
	    simd_fmca2 (PK587785252PK587785252, t1165, t1132, t1147);
	    simd_st2 (t1131, inout[iostride * 4]);
	    simd_st2 (t1147, inout[iostride]);
	    simd_swapchsH2 (t1176, t1174);
	    simd_fmca2 (PK951056516PK951056516, t1174, t1150, t1155);
	    simd_fnmca2 (PK951056516PK951056516, t1174, t1150, t1149);
	    simd_st2 (t1155, inout[iostride * 3]);
	    simd_st2 (t1149, inout[iostride * 2]);
       }
}


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

fftw_codelet_desc fftw_twiddle_5_desc = {
     "fftw_twiddle_5",
     (void (*)()) fftw_twiddle_5,
     5,
     FFTW_FORWARD,
     FFTW_TWIDDLE,
     110,
     4,
     twiddle_order,
};
