1 2 extern void cpass(complex *,const complex *,unsigned int); 3 extern void cpassbig(complex *,const complex *,unsigned int); 4 extern void upass(complex *,const complex *,unsigned int); 5 extern void upassbig(complex *,const complex *,unsigned int); 6 extern void rpass(real *,const complex *,unsigned int); 7 extern void rpassbig(real *,const complex *,unsigned int); 8 extern void vpass(real *,const complex *,unsigned int); 9 extern void vpassbig(real *,const complex *,unsigned int); 10 11 extern const complex d16[]; 12 extern const complex d32[]; 13 extern const complex d64[]; 14 extern const complex d128[]; 15 extern const complex d256[]; 16 extern const complex d512[]; 17 extern const complex d1024[]; 18 extern const complex d2048[]; 19 extern const complex d4096[]; 20 extern const complex d8192[]; 21 extern const complex d16384[]; 22 extern const complex d32768[]; 23 extern const complex d65536[]; 24 25 #define sqrthalf (d16[1].re) 26 27 #define VOL *(volatile real *)& 28 29 #define TRANSFORM(a0,a1,a2,a3,wre,wim) { \ 30 t6 = a2.re; \ 31 t1 = a0.re - t6; \ 32 t6 += a0.re; \ 33 a0.re = t6; \ 34 t3 = a3.im; \ 35 t4 = a1.im - t3; \ 36 t8 = t1 - t4; \ 37 t1 += t4; \ 38 t3 += a1.im; \ 39 a1.im = t3; \ 40 t5 = wre; \ 41 t7 = t8 * t5; \ 42 t4 = t1 * t5; \ 43 t8 *= wim; \ 44 t2 = a3.re; \ 45 t3 = a1.re - t2; \ 46 t2 += a1.re; \ 47 a1.re = t2; \ 48 t1 *= wim; \ 49 t6 = a2.im; \ 50 t2 = a0.im - t6; \ 51 t6 += a0.im; \ 52 a0.im = t6; \ 53 t6 = t2 + t3; \ 54 t2 -= t3; \ 55 t3 = t6 * wim; \ 56 t7 -= t3; \ 57 a2.re = t7; \ 58 t6 *= t5; \ 59 t6 += t8; \ 60 a2.im = t6; \ 61 t5 *= t2; \ 62 t5 -= t1; \ 63 a3.im = t5; \ 64 t2 *= wim; \ 65 t4 += t2; \ 66 a3.re = t4; \ 67 } 68 69 #define TRANSFORMHALF(a0,a1,a2,a3) { \ 70 t1 = a2.re; \ 71 t5 = a0.re - t1; \ 72 t1 += a0.re; \ 73 a0.re = t1; \ 74 t4 = a3.im; \ 75 t8 = a1.im - t4; \ 76 t1 = t5 - t8; \ 77 t5 += t8; \ 78 t4 += a1.im; \ 79 a1.im = t4; \ 80 t3 = a3.re; \ 81 t7 = a1.re - t3; \ 82 t3 += a1.re; \ 83 a1.re = t3; \ 84 t8 = a2.im; \ 85 t6 = a0.im - t8; \ 86 t2 = t6 + t7; \ 87 t6 -= t7; \ 88 t8 += a0.im; \ 89 a0.im = t8; \ 90 t4 = t6 + t5; \ 91 t3 = sqrthalf; \ 92 t4 *= t3; \ 93 a3.re = t4; \ 94 t6 -= t5; \ 95 t6 *= t3; \ 96 a3.im = t6; \ 97 t7 = t1 - t2; \ 98 t7 *= t3; \ 99 a2.re = t7; \ 100 t2 += t1; \ 101 t2 *= t3; \ 102 a2.im = t2; \ 103 } 104 105 #define TRANSFORMZERO(a0,a1,a2,a3) { \ 106 t5 = a2.re; \ 107 t1 = a0.re - t5; \ 108 t5 += a0.re; \ 109 a0.re = t5; \ 110 t8 = a3.im; \ 111 t4 = a1.im - t8; \ 112 t7 = a3.re; \ 113 t6 = t1 - t4; \ 114 a2.re = t6; \ 115 t1 += t4; \ 116 a3.re = t1; \ 117 t8 += a1.im; \ 118 a1.im = t8; \ 119 t3 = a1.re - t7; \ 120 t7 += a1.re; \ 121 a1.re = t7; \ 122 t6 = a2.im; \ 123 t2 = a0.im - t6; \ 124 t7 = t2 + t3; \ 125 a2.im = t7; \ 126 t2 -= t3; \ 127 a3.im = t2; \ 128 t6 += a0.im; \ 129 a0.im = t6; \ 130 } 131 132 #define UNTRANSFORM(a0,a1,a2,a3,wre,wim) { \ 133 t6 = VOL wre; \ 134 t1 = VOL a2.re; \ 135 t1 *= t6; \ 136 t8 = VOL wim; \ 137 t3 = VOL a2.im; \ 138 t3 *= t8; \ 139 t2 = VOL a2.im; \ 140 t4 = VOL a2.re; \ 141 t5 = VOL a3.re; \ 142 t5 *= t6; \ 143 t7 = VOL a3.im; \ 144 t1 += t3; \ 145 t7 *= t8; \ 146 t5 -= t7; \ 147 t3 = t5 + t1; \ 148 t5 -= t1; \ 149 t2 *= t6; \ 150 t6 *= a3.im; \ 151 t4 *= t8; \ 152 t2 -= t4; \ 153 t8 *= a3.re; \ 154 t6 += t8; \ 155 t1 = a0.re - t3; \ 156 t3 += a0.re; \ 157 a0.re = t3; \ 158 t7 = a1.im - t5; \ 159 t5 += a1.im; \ 160 a1.im = t5; \ 161 t4 = t2 - t6; \ 162 t6 += t2; \ 163 t8 = a1.re - t4; \ 164 t4 += a1.re; \ 165 a1.re = t4; \ 166 t2 = a0.im - t6; \ 167 t6 += a0.im; \ 168 a0.im = t6; \ 169 a2.re = t1; \ 170 a3.im = t7; \ 171 a3.re = t8; \ 172 a2.im = t2; \ 173 } 174 175 176 #define UNTRANSFORMHALF(a0,a1,a2,a3) { \ 177 t6 = sqrthalf; \ 178 t1 = a2.re; \ 179 t2 = a2.im - t1; \ 180 t2 *= t6; \ 181 t1 += a2.im; \ 182 t1 *= t6; \ 183 t4 = a3.im; \ 184 t3 = a3.re - t4; \ 185 t3 *= t6; \ 186 t4 += a3.re; \ 187 t4 *= t6; \ 188 t8 = t3 - t1; \ 189 t7 = t2 - t4; \ 190 t1 += t3; \ 191 t2 += t4; \ 192 t4 = a1.im - t8; \ 193 a3.im = t4; \ 194 t8 += a1.im; \ 195 a1.im = t8; \ 196 t3 = a1.re - t7; \ 197 a3.re = t3; \ 198 t7 += a1.re; \ 199 a1.re = t7; \ 200 t5 = a0.re - t1; \ 201 a2.re = t5; \ 202 t1 += a0.re; \ 203 a0.re = t1; \ 204 t6 = a0.im - t2; \ 205 a2.im = t6; \ 206 t2 += a0.im; \ 207 a0.im = t2; \ 208 } 209 210 #define UNTRANSFORMZERO(a0,a1,a2,a3) { \ 211 t2 = a3.im; \ 212 t3 = a2.im - t2; \ 213 t2 += a2.im; \ 214 t1 = a2.re; \ 215 t4 = a3.re - t1; \ 216 t1 += a3.re; \ 217 t5 = a0.re - t1; \ 218 a2.re = t5; \ 219 t6 = a0.im - t2; \ 220 a2.im = t6; \ 221 t7 = a1.re - t3; \ 222 a3.re = t7; \ 223 t8 = a1.im - t4; \ 224 a3.im = t8; \ 225 t1 += a0.re; \ 226 a0.re = t1; \ 227 t2 += a0.im; \ 228 a0.im = t2; \ 229 t3 += a1.re; \ 230 a1.re = t3; \ 231 t4 += a1.im; \ 232 a1.im = t4; \ 233 } 234 235 #define R(a0,a1,b0,b1,wre,wim) { \ 236 t1 = a0 - a1; \ 237 t2 = b0 - b1; \ 238 t5 = t1 * wim; \ 239 t6 = t2 * wim; \ 240 t3 = VOL a0; \ 241 t1 *= wre; \ 242 t3 += a1; \ 243 t2 *= wre; \ 244 t1 -= t6; \ 245 t4 = VOL b0; \ 246 t2 += t5; \ 247 t4 += b1; \ 248 a0 = t3; \ 249 b1 = t2; \ 250 a1 = t4; \ 251 b0 = t1; \ 252 } 253 254 #define RHALF(a0,a1,b0,b1) { \ 255 t1 = a0 - a1; \ 256 t2 = b0 - b1; \ 257 t3 = a0 + a1; \ 258 t5 = t1 - t2; \ 259 t1 += t2; \ 260 t4 = VOL b0; \ 261 t5 *= sqrthalf; \ 262 t4 += b1; \ 263 t1 *= sqrthalf; \ 264 a0 = t3; \ 265 b1 = t1; \ 266 a1 = t4; \ 267 b0 = t5; \ 268 } 269 270 #define RZERO(a0,a1,b0,b1) { \ 271 t1 = a0 - a1; \ 272 t2 = b0 - b1; \ 273 t3 = a0 + a1; \ 274 t4 = b0 + b1; \ 275 b0 = t1; \ 276 a0 = t3; \ 277 b1 = t2; \ 278 a1 = t4; \ 279 } 280 281 #define V(a0,a1,b0,b1,wre,wim) { \ 282 t5 = b0 * wre; \ 283 t1 = b1 * wim; \ 284 t6 = b1 * wre; \ 285 t5 += t1; \ 286 t3 = b0 * wim; \ 287 t2 = a0 - t5; \ 288 t6 -= t3; \ 289 t5 += a0; \ 290 t4 = a1 - t6; \ 291 t6 += a1; \ 292 a1 = t2; \ 293 a0 = t5; \ 294 b1 = t4; \ 295 b0 = t6; \ 296 } 297 298 #define VHALF(a0,a1,b0,b1) { \ 299 t5 = b0 + b1; \ 300 t6 = b1 - b0; \ 301 t5 *= sqrthalf; \ 302 t2 = VOL a0; \ 303 t6 *= sqrthalf; \ 304 t2 -= t5; \ 305 t5 += a0; \ 306 t4 = a1 - t6; \ 307 t6 += a1; \ 308 a1 = t2; \ 309 a0 = t5; \ 310 b0 = t6; \ 311 b1 = t4; \ 312 } 313 314 #define VZERO(a0,a1,b0,b1) { \ 315 t1 = a0 + b0; \ 316 t2 = a0 - b0; \ 317 t3 = a1 + b1; \ 318 t4 = a1 - b1; \ 319 a0 = t1; \ 320 b0 = t3; \ 321 a1 = t2; \ 322 b1 = t4; \ 323 } 324