|
|
|
@ -551,7 +551,7 @@ sub fft_loop_macros {
|
|
|
|
|
# mul_result = gsl_complex (c1.re * c2.re - c1.im * c2.im, c1.re * c2.im + c1.im * c2.re);
|
|
|
|
|
print "
|
|
|
|
|
#define WMULTIPLY(Wre,Wim,Dre,Dim) { \\
|
|
|
|
|
register $tmp_ieee_type T1re, T1im, T2re, T2im; \\
|
|
|
|
|
$tmp_ieee_type T1re, T1im, T2re, T2im; \\
|
|
|
|
|
T1re = Wre * Dre; \\
|
|
|
|
|
T1im = Wim * Dre; \\
|
|
|
|
|
T2re = Wim * Dim; \\
|
|
|
|
@ -567,7 +567,7 @@ sub butterfly_macros {
|
|
|
|
|
# add_result = gsl_complex (c1.re + c2.re, c1.im + c2.im);
|
|
|
|
|
print "
|
|
|
|
|
#define BUTTERFLY_XY(X1re,X1im,X2re,X2im,Y1re,Y1im,Y2re,Y2im,Wre,Wim) { \\
|
|
|
|
|
register $tmp_ieee_type T1re, T1im, T2re, T2im; \\
|
|
|
|
|
$tmp_ieee_type T1re, T1im, T2re, T2im; \\
|
|
|
|
|
T1re = X2re * Wre; \\
|
|
|
|
|
T1im = X2im * Wre; \\
|
|
|
|
|
T2re = X2im * Wim; \\
|
|
|
|
@ -582,7 +582,7 @@ sub butterfly_macros {
|
|
|
|
|
Y2im = T2im; \\
|
|
|
|
|
}
|
|
|
|
|
#define BUTTERFLY_Yx(X1re,X1im,X2re,X2im,Y1re,Y1im,Y2re,Y2im,Wre,Wim) { \\
|
|
|
|
|
register $tmp_ieee_type T1re, T1im, T2re, T2im; \\
|
|
|
|
|
$tmp_ieee_type T1re, T1im, T2re, T2im; \\
|
|
|
|
|
T1re = X2re * Wim; \\
|
|
|
|
|
T1im = X2im * Wim; \\
|
|
|
|
|
T2re = X2im * Wre; \\
|
|
|
|
@ -597,7 +597,7 @@ sub butterfly_macros {
|
|
|
|
|
Y2im = T2im; \\
|
|
|
|
|
}
|
|
|
|
|
#define BUTTERFLY_yX(X1re,X1im,X2re,X2im,Y1re,Y1im,Y2re,Y2im,Wre,Wim) { \\
|
|
|
|
|
register $tmp_ieee_type T1re, T1im, T2re, T2im; \\
|
|
|
|
|
$tmp_ieee_type T1re, T1im, T2re, T2im; \\
|
|
|
|
|
T1re = X2re * Wim; \\
|
|
|
|
|
T1im = X2im * Wim; \\
|
|
|
|
|
T2re = X2im * Wre; \\
|
|
|
|
@ -612,7 +612,7 @@ sub butterfly_macros {
|
|
|
|
|
Y2im = T2im; \\
|
|
|
|
|
}
|
|
|
|
|
#define BUTTERFLY_10(X1re,X1im,X2re,X2im,Y1re,Y1im,Y2re,Y2im,_1,_2) { \\
|
|
|
|
|
register $tmp_ieee_type T2re, T2im; \\
|
|
|
|
|
$tmp_ieee_type T2re, T2im; \\
|
|
|
|
|
T2re = X1re - X2re; \\
|
|
|
|
|
T2im = X1im - X2im; \\
|
|
|
|
|
Y1re = X1re + X2re; \\
|
|
|
|
@ -621,7 +621,7 @@ sub butterfly_macros {
|
|
|
|
|
Y2im = T2im; \\
|
|
|
|
|
}
|
|
|
|
|
#define BUTTERFLY_01(X1re,X1im,X2re,X2im,Y1re,Y1im,Y2re,Y2im,_1,_2) { \\
|
|
|
|
|
register $tmp_ieee_type T2re, T2im; \\
|
|
|
|
|
$tmp_ieee_type T2re, T2im; \\
|
|
|
|
|
T2re = X1re + X2im; \\
|
|
|
|
|
T2im = X1im - X2re; \\
|
|
|
|
|
Y1re = X1re - X2im; \\
|
|
|
|
@ -630,7 +630,7 @@ sub butterfly_macros {
|
|
|
|
|
Y2im = T2im; \\
|
|
|
|
|
}
|
|
|
|
|
#define BUTTERFLY_0m(X1re,X1im,X2re,X2im,Y1re,Y1im,Y2re,Y2im,_1,_2) { \\
|
|
|
|
|
register $tmp_ieee_type T2re, T2im; \\
|
|
|
|
|
$tmp_ieee_type T2re, T2im; \\
|
|
|
|
|
T2re = X1re - X2im; \\
|
|
|
|
|
T2im = X1im + X2re; \\
|
|
|
|
|
Y1re = X1re + X2im; \\
|
|
|
|
@ -639,7 +639,7 @@ sub butterfly_macros {
|
|
|
|
|
Y2im = T2im; \\
|
|
|
|
|
}
|
|
|
|
|
#define BUTTERFLY_XX(X1re,X1im,X2re,X2im,Y1re,Y1im,Y2re,Y2im,Wre,_2) { \\
|
|
|
|
|
register $tmp_ieee_type T1re, T1im, T2re, T2im; \\
|
|
|
|
|
$tmp_ieee_type T1re, T1im, T2re, T2im; \\
|
|
|
|
|
T1re = X2re * Wre; \\
|
|
|
|
|
T1im = X2im * Wre; \\
|
|
|
|
|
T2re = T1im; \\
|
|
|
|
@ -654,7 +654,7 @@ sub butterfly_macros {
|
|
|
|
|
Y2im = T2im; \\
|
|
|
|
|
}
|
|
|
|
|
#define BUTTERFLY_yY(X1re,X1im,X2re,X2im,Y1re,Y1im,Y2re,Y2im,Wre,_2) { \\
|
|
|
|
|
register $tmp_ieee_type T1re, T1im, T2re, T2im; \\
|
|
|
|
|
$tmp_ieee_type T1re, T1im, T2re, T2im; \\
|
|
|
|
|
T1re = X2re * Wre; \\
|
|
|
|
|
T1im = X2im * Wre; \\
|
|
|
|
|
T2re = T1im; \\
|
|
|
|
@ -669,7 +669,7 @@ sub butterfly_macros {
|
|
|
|
|
Y2im = T2im; \\
|
|
|
|
|
}
|
|
|
|
|
#define BUTTERFLY_10scale(X1re,X1im,X2re,X2im,Y1re,Y1im,Y2re,Y2im,S) { \\
|
|
|
|
|
register $tmp_ieee_type T2re, T2im; \\
|
|
|
|
|
$tmp_ieee_type T2re, T2im; \\
|
|
|
|
|
T2re = X1re - X2re; \\
|
|
|
|
|
T2im = X1im - X2im; \\
|
|
|
|
|
Y1re = X1re + X2re; \\
|
|
|
|
@ -790,8 +790,8 @@ print " **/\n";
|
|
|
|
|
$fft_size, $negate_sign ? "synthesis" : "analysis",
|
|
|
|
|
$skip2 ? "_skip2" : "",
|
|
|
|
|
$ieee_type, $ieee_type);
|
|
|
|
|
printf "%sregister unsigned int butterfly, block, offset;\n", $indent;
|
|
|
|
|
printf "%sregister %s Wre, Wim;\n\n", $indent, $tmp_ieee_type, $tmp_ieee_type;
|
|
|
|
|
printf "%sunsigned int butterfly, block, offset;\n", $indent;
|
|
|
|
|
printf "%s%s Wre, Wim;\n\n", $indent, $tmp_ieee_type, $tmp_ieee_type;
|
|
|
|
|
printf "%sbutterfly = block = offset = 0, Wre = Wim = 0.0; /* silence compiler */\n", $indent;
|
|
|
|
|
|
|
|
|
|
my $seen_rule = 0;
|
|
|
|
|