[sdiy] Re: 1970's again? Now DSP assembly

Antti Huovilainen ajhuovil at cc.hut.fi
Mon Jan 31 13:58:19 CET 2005


On Mon, 31 Jan 2005, Kenneth Elhardt wrote:

> And everytime I hear that C produces the same code or runs just about as
> fast as assembly, I want to scream.  I am constantly horrified by how
> inefficient some C generated code is.  Take this simple FIR filter line I
> wrote in C:
>
>  for(k=0;k<=510;k++) ftemp+=(fir[k]*(float)*s++);

float ftemp = 0, ftemp2 = 0;
for (k = 0; k < 510; k+=2)
{
   ftemp += fir[k]*s[k];
   ftemp2 += fir[k+1]*s[k+1];
}
ftemp += fir[510]*s[510] + ftemp2;
s += 511;

gives double speed on modern x86 cpus (tested with Intel's ICC7.1 
compiler).

Antti

Give a man a fire, and he'll be warm that day,
Set him alight and he'll be warm for the rest of his life



More information about the Synth-diy mailing list