1 /*
2  * Copyright (c) 1997-1999, 2003 Massachusetts Institute of Technology
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  *
18  */
19 
20 /* This file was automatically generated --- DO NOT EDIT */
21 /* Generated on Mon Mar 24 02:07:49 EST 2003 */
22 
23 #include "fftw-int.h"
24 #include "fftw.h"
25 
26 /* Generated by: /homee/stevenj/cvs/fftw/gensrc/genfft -magic-alignment-check -magic-twiddle-load-all -magic-variables 4 -magic-loopi -hc2hc-forward 4 */
27 
28 /*
29  * This function contains 34 FP additions, 14 FP multiplications,
30  * (or, 28 additions, 8 multiplications, 6 fused multiply/add),
31  * 15 stack variables, and 32 memory accesses
32  */
33 static const fftw_real K707106781 =
34 FFTW_KONST(+0.707106781186547524400844362104849039284835938);
35 
36 /*
37  * Generator Id's :
38  * $Id: exprdag.ml,v 1.43 2003/03/16 23:43:46 stevenj Exp $
39  * $Id: fft.ml,v 1.44 2003/03/16 23:43:46 stevenj Exp $
40  * $Id: to_c.ml,v 1.26 2003/03/16 23:43:46 stevenj Exp $
41  */
42 
fftw_hc2hc_forward_4(fftw_real * A,const fftw_complex * W,int iostride,int m,int dist)43 void fftw_hc2hc_forward_4(fftw_real *A, const fftw_complex *W,
44 			  int iostride, int m, int dist)
45 {
46      int i;
47      fftw_real *X;
48      fftw_real *Y;
49      X = A;
50      Y = A + (4 * iostride);
51      {
52 	  fftw_real tmp35;
53 	  fftw_real tmp36;
54 	  fftw_real tmp37;
55 	  fftw_real tmp38;
56 	  fftw_real tmp39;
57 	  fftw_real tmp40;
58 	  ASSERT_ALIGNED_DOUBLE;
59 	  tmp35 = X[0];
60 	  tmp36 = X[2 * iostride];
61 	  tmp37 = tmp35 + tmp36;
62 	  tmp38 = X[iostride];
63 	  tmp39 = X[3 * iostride];
64 	  tmp40 = tmp38 + tmp39;
65 	  X[iostride] = tmp35 - tmp36;
66 	  Y[-iostride] = -(tmp38 - tmp39);
67 	  X[2 * iostride] = tmp37 - tmp40;
68 	  X[0] = tmp37 + tmp40;
69      }
70      X = X + dist;
71      Y = Y - dist;
72      for (i = 2; i < m; i = i + 2, X = X + dist, Y = Y - dist, W = W + 3) {
73 	  fftw_real tmp7;
74 	  fftw_real tmp30;
75 	  fftw_real tmp12;
76 	  fftw_real tmp29;
77 	  fftw_real tmp18;
78 	  fftw_real tmp26;
79 	  fftw_real tmp23;
80 	  fftw_real tmp27;
81 	  ASSERT_ALIGNED_DOUBLE;
82 	  tmp7 = X[0];
83 	  tmp30 = Y[-3 * iostride];
84 	  {
85 	       fftw_real tmp9;
86 	       fftw_real tmp11;
87 	       fftw_real tmp8;
88 	       fftw_real tmp10;
89 	       ASSERT_ALIGNED_DOUBLE;
90 	       tmp9 = X[2 * iostride];
91 	       tmp11 = Y[-iostride];
92 	       tmp8 = c_re(W[1]);
93 	       tmp10 = c_im(W[1]);
94 	       tmp12 = (tmp8 * tmp9) - (tmp10 * tmp11);
95 	       tmp29 = (tmp10 * tmp9) + (tmp8 * tmp11);
96 	  }
97 	  {
98 	       fftw_real tmp15;
99 	       fftw_real tmp17;
100 	       fftw_real tmp14;
101 	       fftw_real tmp16;
102 	       ASSERT_ALIGNED_DOUBLE;
103 	       tmp15 = X[iostride];
104 	       tmp17 = Y[-2 * iostride];
105 	       tmp14 = c_re(W[0]);
106 	       tmp16 = c_im(W[0]);
107 	       tmp18 = (tmp14 * tmp15) - (tmp16 * tmp17);
108 	       tmp26 = (tmp16 * tmp15) + (tmp14 * tmp17);
109 	  }
110 	  {
111 	       fftw_real tmp20;
112 	       fftw_real tmp22;
113 	       fftw_real tmp19;
114 	       fftw_real tmp21;
115 	       ASSERT_ALIGNED_DOUBLE;
116 	       tmp20 = X[3 * iostride];
117 	       tmp22 = Y[0];
118 	       tmp19 = c_re(W[2]);
119 	       tmp21 = c_im(W[2]);
120 	       tmp23 = (tmp19 * tmp20) - (tmp21 * tmp22);
121 	       tmp27 = (tmp21 * tmp20) + (tmp19 * tmp22);
122 	  }
123 	  {
124 	       fftw_real tmp13;
125 	       fftw_real tmp24;
126 	       fftw_real tmp33;
127 	       fftw_real tmp34;
128 	       ASSERT_ALIGNED_DOUBLE;
129 	       tmp13 = tmp7 + tmp12;
130 	       tmp24 = tmp18 + tmp23;
131 	       Y[-2 * iostride] = tmp13 - tmp24;
132 	       X[0] = tmp13 + tmp24;
133 	       tmp33 = tmp18 - tmp23;
134 	       tmp34 = tmp30 - tmp29;
135 	       X[3 * iostride] = -(tmp33 + tmp34);
136 	       Y[-iostride] = tmp34 - tmp33;
137 	  }
138 	  {
139 	       fftw_real tmp31;
140 	       fftw_real tmp32;
141 	       fftw_real tmp25;
142 	       fftw_real tmp28;
143 	       ASSERT_ALIGNED_DOUBLE;
144 	       tmp31 = tmp29 + tmp30;
145 	       tmp32 = tmp26 + tmp27;
146 	       X[2 * iostride] = -(tmp31 - tmp32);
147 	       Y[0] = tmp32 + tmp31;
148 	       tmp25 = tmp7 - tmp12;
149 	       tmp28 = tmp26 - tmp27;
150 	       Y[-3 * iostride] = tmp25 - tmp28;
151 	       X[iostride] = tmp25 + tmp28;
152 	  }
153      }
154      if (i == m) {
155 	  fftw_real tmp1;
156 	  fftw_real tmp6;
157 	  fftw_real tmp4;
158 	  fftw_real tmp5;
159 	  fftw_real tmp2;
160 	  fftw_real tmp3;
161 	  ASSERT_ALIGNED_DOUBLE;
162 	  tmp1 = X[0];
163 	  tmp6 = X[2 * iostride];
164 	  tmp2 = X[iostride];
165 	  tmp3 = X[3 * iostride];
166 	  tmp4 = K707106781 * (tmp2 - tmp3);
167 	  tmp5 = K707106781 * (tmp2 + tmp3);
168 	  X[iostride] = tmp1 - tmp4;
169 	  X[0] = tmp1 + tmp4;
170 	  Y[0] = -(tmp5 + tmp6);
171 	  Y[-iostride] = tmp6 - tmp5;
172      }
173 }
174 
175 static const int twiddle_order[] = { 1, 2, 3 };
176 fftw_codelet_desc fftw_hc2hc_forward_4_desc = {
177      "fftw_hc2hc_forward_4",
178      (void (*)()) fftw_hc2hc_forward_4,
179      4,
180      FFTW_FORWARD,
181      FFTW_HC2HC,
182      91,
183      3,
184      twiddle_order,
185 };
186