Steve
2016-09-06 18:07:14 UTC
I was playing around with gcc this morning, and looking at the assembler
code produced by the 64-bit Ubuntu. Obviously all the "float" data types is
not going to perform any magic, but I thought I would see what switches
might make it work.
Well after looking at many options, none of them worked. The compiler more
often than not converted between doubles and floats willy-nilly.
Not a big deal on a GUI app, and all that float stuff was, I assume, to
benefit the ARM firmware, where it probably does the right thing, as there
are no doubles.
Anyway, one last test, I added "-m32 -mfpmath=387" and that required me to
install "libc6-dev-i386" which I could have saved time by just booting up
my 32-bit virtual Ubuntu :-)
But anyway, it did fill the directory with 32-bit applications. I don't
know if there are any advantages to running a 32-bit App on a 64-bit
machine though.
What I also looked at was to see if the optimizer would optimize out a
double multiply in sine.c. Alas, it does not.
in "hs_pitch_refinement" and "estimate_amplitudes" there's loops that do
two multiplies where it could do only one:
Wo = TWO_PI/p;
/* Sum harmonic magnitudes */
for(m=1; m<=model->L; m++) {
b = (int)(m*Wo*one_on_r + 0.5); <---- two mult
E += Sw[b].real*Sw[b].real + Sw[b].imag*Sw[b].imag;
}
and
one_on_r = 1.0/r;
for(m=1; m<=model->L; m++) {
den = 0.0;
am = (int)((m - 0.5)*model->Wo*one_on_r + 0.5);<--- two mult
bm = (int)((m + 0.5)*model->Wo*one_on_r + 0.5);<--- two mult
I changed mine to:
Wo = TAU / p;
tmp = Wo * one_on_r;
/* Sum harmonic magnitudes */
for (m = 1; m <= model->L; m++) {
b = (int) (m * tmp + 0.5f); <---- one mult
E += Sw[b].real * Sw[b].real + Sw[b].imag * Sw[b].imag;
}
and
one_on_r = model->Wo * (1.0/r);
for (m = 1; m <= model->L; m++) {
den = 0.0;
am = (int) ((m - 0.5f) * one_on_r + 0.5f);<--- one mult
bm = (int) ((m + 0.5f) * one_on_r + 0.5f);<--- one mult
That's all I know...
code produced by the 64-bit Ubuntu. Obviously all the "float" data types is
not going to perform any magic, but I thought I would see what switches
might make it work.
Well after looking at many options, none of them worked. The compiler more
often than not converted between doubles and floats willy-nilly.
Not a big deal on a GUI app, and all that float stuff was, I assume, to
benefit the ARM firmware, where it probably does the right thing, as there
are no doubles.
Anyway, one last test, I added "-m32 -mfpmath=387" and that required me to
install "libc6-dev-i386" which I could have saved time by just booting up
my 32-bit virtual Ubuntu :-)
But anyway, it did fill the directory with 32-bit applications. I don't
know if there are any advantages to running a 32-bit App on a 64-bit
machine though.
What I also looked at was to see if the optimizer would optimize out a
double multiply in sine.c. Alas, it does not.
in "hs_pitch_refinement" and "estimate_amplitudes" there's loops that do
two multiplies where it could do only one:
Wo = TWO_PI/p;
/* Sum harmonic magnitudes */
for(m=1; m<=model->L; m++) {
b = (int)(m*Wo*one_on_r + 0.5); <---- two mult
E += Sw[b].real*Sw[b].real + Sw[b].imag*Sw[b].imag;
}
and
one_on_r = 1.0/r;
for(m=1; m<=model->L; m++) {
den = 0.0;
am = (int)((m - 0.5)*model->Wo*one_on_r + 0.5);<--- two mult
bm = (int)((m + 0.5)*model->Wo*one_on_r + 0.5);<--- two mult
I changed mine to:
Wo = TAU / p;
tmp = Wo * one_on_r;
/* Sum harmonic magnitudes */
for (m = 1; m <= model->L; m++) {
b = (int) (m * tmp + 0.5f); <---- one mult
E += Sw[b].real * Sw[b].real + Sw[b].imag * Sw[b].imag;
}
and
one_on_r = model->Wo * (1.0/r);
for (m = 1; m <= model->L; m++) {
den = 0.0;
am = (int) ((m - 0.5f) * one_on_r + 0.5f);<--- one mult
bm = (int) ((m + 0.5f) * one_on_r + 0.5f);<--- one mult
That's all I know...