/*
 * 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);
DECLARE_SIMD_CONST2 (PK500000000PK500000000, +0.5000000000000000000000000,
		     +0.5000000000000000000000000);
DECLARE_SIMD_CONST2 (PK866025403PK866025403, +0.8660254037844386467637232,
		     +0.8660254037844386467637232);

void
fftwi_twiddle_3 (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 += 2)
       {
	    DECLARE_SIMD_TMPVAR2 (t1082);
	    DECLARE_SIMD_TMPVAR2 (t1095);
	    DECLARE_SIMD_TMPVAR2 (t1081);
	    DECLARE_SIMD_TMPVAR2 (t1079);
	    DECLARE_SIMD_TMPVAR2 (t1093);
	    DECLARE_SIMD_TMPVAR2 (t1085);
	    DECLARE_SIMD_TMPVAR2 (t1084);
	    DECLARE_SIMD_TMPVAR2 (t1083);
	    DECLARE_SIMD_TMPVAR2 (t1080);
	    DECLARE_SIMD_TMPVAR2 (t1092);
	    DECLARE_SIMD_TMPVAR2 (t1105);
	    DECLARE_SIMD_TMPVAR2 (t1104);
	    DECLARE_SIMD_TMPVAR2 (t1063);
	    DECLARE_SIMD_TMPVAR2 (t1107);
	    DECLARE_SIMD_TMPVAR2 (t1106);
	    DECLARE_SIMD_TMPVAR2 (t1064);
	    DECLARE_SIMD_TMPVAR2 (t1102);
	    DECLARE_SIMD_TMPVAR2 (t1062);
	    DECLARE_SIMD_TMPVAR2 (t1061);
	    DECLARE_SIMD_TMPVAR2 (t1060);
	    DECLARE_SIMD_TMPVAR2 (t1097);
	    DECLARE_SIMD_TMPVAR2 (t1100);
	    DECLARE_SIMD_TMPVAR2 (t1096);
	    DECLARE_SIMD_TMPVAR2 (t1103);

	    simd_ld2 (inout[iostride], t1082);
	    simd_swap2 (t1082, t1095);
	    simd_ld2 (W[0], t1081);
	    simd_mul2 (t1081, t1082, t1079);
	    simd_mul2 (t1081, t1095, t1093);
	    simd_ld2 (inout[iostride * 2], t1085);
	    simd_swap2 (t1085, t1084);
	    simd_ld2 (W[1], t1083);
	    simd_mul2 (t1083, t1084, t1080);
	    simd_mul2 (t1083, t1085, t1092);
	    simd_unpckL2 (t1079, t1080, t1105);
	    simd_unpckH2 (t1079, t1080, t1104);
	    simd_fmca2 (PK1_000000000NK1_000000000, t1104, t1105, t1063);
	    simd_unpckL2 (t1092, t1093, t1107);
	    simd_unpckH2 (t1092, t1093, t1106);
	    simd_fmca2 (PK1_000000000NK1_000000000, t1106, t1107, t1064);
	    simd_sub2 (t1063, t1064, t1102);
	    simd_add2 (t1063, t1064, t1062);
	    simd_ld2 (inout[0], t1061);
	    simd_add2 (t1061, t1062, t1060);
	    simd_fnmca2 (PK500000000PK500000000, t1062, t1061, t1097);
	    simd_st2 (t1060, inout[0]);
	    simd_swap2 (t1102, t1100);
	    simd_fnmca2 (PK866025403PK866025403, t1100, t1097, t1096);
	    simd_fmca2 (PK866025403PK866025403, t1100, t1097, t1103);
	    simd_st2 (t1096, inout[iostride * 2]);
	    simd_st2 (t1103, inout[iostride]);
       }
}


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

fftw_codelet_desc fftwi_twiddle_3_desc = {
     "fftwi_twiddle_3",
     (void (*)()) fftwi_twiddle_3,
     3,
     FFTW_BACKWARD,
     FFTW_TWIDDLE,
     77,
     2,
     twiddle_order,
};
