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:08:51 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-backward 3 */
27 
28 /*
29  * This function contains 24 FP additions, 16 FP multiplications,
30  * (or, 16 additions, 8 multiplications, 8 fused multiply/add),
31  * 15 stack variables, and 24 memory accesses
32  */
33 static const fftw_real K500000000 =
34 FFTW_KONST(+0.500000000000000000000000000000000000000000000);
35 static const fftw_real K866025403 =
36 FFTW_KONST(+0.866025403784438646763723170752936183471402627);
37 static const fftw_real K2_000000000 =
38 FFTW_KONST(+2.000000000000000000000000000000000000000000000);
39 static const fftw_real K1_732050807 =
40 FFTW_KONST(+1.732050807568877293527446341505872366942805254);
41 
42 /*
43  * Generator Id's :
44  * $Id: exprdag.ml,v 1.43 2003/03/16 23:43:46 stevenj Exp $
45  * $Id: fft.ml,v 1.44 2003/03/16 23:43:46 stevenj Exp $
46  * $Id: to_c.ml,v 1.26 2003/03/16 23:43:46 stevenj Exp $
47  */
48 
fftw_hc2hc_backward_3(fftw_real * A,const fftw_complex * W,int iostride,int m,int dist)49 void fftw_hc2hc_backward_3(fftw_real *A, const fftw_complex *W,
50 			   int iostride, int m, int dist)
51 {
52      int i;
53      fftw_real *X;
54      fftw_real *Y;
55      X = A;
56      Y = A + (3 * iostride);
57      {
58 	  fftw_real tmp30;
59 	  fftw_real tmp26;
60 	  fftw_real tmp27;
61 	  fftw_real tmp28;
62 	  fftw_real tmp29;
63 	  ASSERT_ALIGNED_DOUBLE;
64 	  tmp29 = Y[-iostride];
65 	  tmp30 = K1_732050807 * tmp29;
66 	  tmp26 = X[0];
67 	  tmp27 = X[iostride];
68 	  tmp28 = tmp26 - tmp27;
69 	  X[0] = tmp26 + (K2_000000000 * tmp27);
70 	  X[iostride] = tmp28 - tmp30;
71 	  X[2 * iostride] = tmp28 + tmp30;
72      }
73      X = X + dist;
74      Y = Y - dist;
75      for (i = 2; i < m; i = i + 2, X = X + dist, Y = Y - dist, W = W + 2) {
76 	  fftw_real tmp6;
77 	  fftw_real tmp9;
78 	  fftw_real tmp15;
79 	  fftw_real tmp19;
80 	  fftw_real tmp10;
81 	  fftw_real tmp13;
82 	  fftw_real tmp16;
83 	  fftw_real tmp20;
84 	  ASSERT_ALIGNED_DOUBLE;
85 	  {
86 	       fftw_real tmp7;
87 	       fftw_real tmp8;
88 	       fftw_real tmp11;
89 	       fftw_real tmp12;
90 	       ASSERT_ALIGNED_DOUBLE;
91 	       tmp6 = X[0];
92 	       tmp7 = X[iostride];
93 	       tmp8 = Y[-2 * iostride];
94 	       tmp9 = tmp7 + tmp8;
95 	       tmp15 = K866025403 * (tmp7 - tmp8);
96 	       tmp19 = tmp6 - (K500000000 * tmp9);
97 	       tmp10 = Y[0];
98 	       tmp11 = Y[-iostride];
99 	       tmp12 = X[2 * iostride];
100 	       tmp13 = tmp11 - tmp12;
101 	       tmp16 = tmp10 - (K500000000 * tmp13);
102 	       tmp20 = K866025403 * (tmp11 + tmp12);
103 	  }
104 	  X[0] = tmp6 + tmp9;
105 	  {
106 	       fftw_real tmp23;
107 	       fftw_real tmp25;
108 	       fftw_real tmp22;
109 	       fftw_real tmp24;
110 	       ASSERT_ALIGNED_DOUBLE;
111 	       tmp23 = tmp16 - tmp15;
112 	       tmp25 = tmp19 + tmp20;
113 	       tmp22 = c_re(W[1]);
114 	       tmp24 = c_im(W[1]);
115 	       Y[0] = (tmp22 * tmp23) - (tmp24 * tmp25);
116 	       X[2 * iostride] = (tmp24 * tmp23) + (tmp22 * tmp25);
117 	  }
118 	  Y[-2 * iostride] = tmp10 + tmp13;
119 	  {
120 	       fftw_real tmp17;
121 	       fftw_real tmp21;
122 	       fftw_real tmp14;
123 	       fftw_real tmp18;
124 	       ASSERT_ALIGNED_DOUBLE;
125 	       tmp17 = tmp15 + tmp16;
126 	       tmp21 = tmp19 - tmp20;
127 	       tmp14 = c_re(W[0]);
128 	       tmp18 = c_im(W[0]);
129 	       Y[-iostride] = (tmp14 * tmp17) - (tmp18 * tmp21);
130 	       X[iostride] = (tmp18 * tmp17) + (tmp14 * tmp21);
131 	  }
132      }
133      if (i == m) {
134 	  fftw_real tmp5;
135 	  fftw_real tmp1;
136 	  fftw_real tmp2;
137 	  fftw_real tmp3;
138 	  fftw_real tmp4;
139 	  ASSERT_ALIGNED_DOUBLE;
140 	  tmp4 = Y[0];
141 	  tmp5 = K1_732050807 * tmp4;
142 	  tmp1 = X[iostride];
143 	  tmp2 = X[0];
144 	  tmp3 = tmp2 - tmp1;
145 	  X[0] = tmp1 + (K2_000000000 * tmp2);
146 	  X[2 * iostride] = -(tmp3 + tmp5);
147 	  X[iostride] = tmp3 - tmp5;
148      }
149 }
150 
151 static const int twiddle_order[] = { 1, 2 };
152 fftw_codelet_desc fftw_hc2hc_backward_3_desc = {
153      "fftw_hc2hc_backward_3",
154      (void (*)()) fftw_hc2hc_backward_3,
155      3,
156      FFTW_BACKWARD,
157      FFTW_HC2HC,
158      80,
159      2,
160      twiddle_order,
161 };
162