/*
 * 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:57 CET 2002 */

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



DECLARE_SIMD_CONST2 (PK1_000000000NK1_000000000, +1.0000000000000000000000000,
		     -1.0000000000000000000000000);

void
fftwi_twiddle_4 (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 += 3)
       {
	    DECLARE_SIMD_TMPVAR2 (t1075);
	    DECLARE_SIMD_TMPVAR2 (t1076);
	    DECLARE_SIMD_TMPVAR2 (t1074);
	    DECLARE_SIMD_TMPVAR2 (t1072);
	    DECLARE_SIMD_TMPVAR2 (t1073);
	    DECLARE_SIMD_TMPVAR2 (t1091);
	    DECLARE_SIMD_TMPVAR2 (t1090);
	    DECLARE_SIMD_TMPVAR2 (t1048);
	    DECLARE_SIMD_TMPVAR2 (t1045);
	    DECLARE_SIMD_TMPVAR2 (t1046);
	    DECLARE_SIMD_TMPVAR2 (t1044);
	    DECLARE_SIMD_TMPVAR2 (t1042);
	    DECLARE_SIMD_TMPVAR2 (t1043);
	    DECLARE_SIMD_TMPVAR2 (t1087);
	    DECLARE_SIMD_TMPVAR2 (t1086);
	    DECLARE_SIMD_TMPVAR2 (t1032);
	    DECLARE_SIMD_TMPVAR2 (t1061);
	    DECLARE_SIMD_TMPVAR2 (t1062);
	    DECLARE_SIMD_TMPVAR2 (t1060);
	    DECLARE_SIMD_TMPVAR2 (t1058);
	    DECLARE_SIMD_TMPVAR2 (t1059);
	    DECLARE_SIMD_TMPVAR2 (t1089);
	    DECLARE_SIMD_TMPVAR2 (t1088);
	    DECLARE_SIMD_TMPVAR2 (t1047);
	    DECLARE_SIMD_TMPVAR2 (t1030);
	    DECLARE_SIMD_TMPVAR2 (t1083);
	    DECLARE_SIMD_TMPVAR2 (t1031);
	    DECLARE_SIMD_TMPVAR2 (t1029);
	    DECLARE_SIMD_TMPVAR2 (t1079);
	    DECLARE_SIMD_TMPVAR2 (t1077);
	    DECLARE_SIMD_TMPVAR2 (t1028);
	    DECLARE_SIMD_TMPVAR2 (t1080);
	    DECLARE_SIMD_TMPVAR2 (t1084);
	    DECLARE_SIMD_TMPVAR2 (t1078);

	    simd_ld2 (inout[iostride * 3], t1075);
	    simd_swap2 (t1075, t1076);
	    simd_ld2 (W[2], t1074);
	    simd_mul2 (t1074, t1075, t1072);
	    simd_mul2 (t1074, t1076, t1073);
	    simd_unpckL2 (t1072, t1073, t1091);
	    simd_unpckH2 (t1072, t1073, t1090);
	    simd_fmca2 (PK1_000000000NK1_000000000, t1090, t1091, t1048);
	    simd_ld2 (inout[iostride * 2], t1045);
	    simd_swap2 (t1045, t1046);
	    simd_ld2 (W[1], t1044);
	    simd_mul2 (t1044, t1045, t1042);
	    simd_mul2 (t1044, t1046, t1043);
	    simd_unpckL2 (t1042, t1043, t1087);
	    simd_unpckH2 (t1042, t1043, t1086);
	    simd_fmca2 (PK1_000000000NK1_000000000, t1086, t1087, t1032);
	    simd_ld2 (inout[iostride], t1061);
	    simd_swap2 (t1061, t1062);
	    simd_ld2 (W[0], t1060);
	    simd_mul2 (t1060, t1061, t1058);
	    simd_mul2 (t1060, t1062, t1059);
	    simd_unpckL2 (t1058, t1059, t1089);
	    simd_unpckH2 (t1058, t1059, t1088);
	    simd_fmca2 (PK1_000000000NK1_000000000, t1088, t1089, t1047);
	    simd_add2 (t1047, t1048, t1030);
	    simd_sub2 (t1047, t1048, t1083);
	    simd_ld2 (inout[0], t1031);
	    simd_add2 (t1031, t1032, t1029);
	    simd_sub2 (t1031, t1032, t1079);
	    simd_add2 (t1029, t1030, t1077);
	    simd_sub2 (t1029, t1030, t1028);
	    simd_st2 (t1077, inout[0]);
	    simd_st2 (t1028, inout[iostride * 2]);
	    simd_swapchsH2 (t1083, t1080);
	    simd_add2 (t1080, t1079, t1084);
	    simd_sub2 (t1079, t1080, t1078);
	    simd_st2 (t1084, inout[iostride * 3]);
	    simd_st2 (t1078, inout[iostride]);
       }
}


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

fftw_codelet_desc fftwi_twiddle_4_desc = {
     "fftwi_twiddle_4",
     (void (*)()) fftwi_twiddle_4,
     4,
     FFTW_BACKWARD,
     FFTW_TWIDDLE,
     99,
     3,
     twiddle_order,
};
