On Sat, 25 Sep 1999, Olivier Langlois wrote:

> I've played a little bit FFTW and I've remarked that its performance can
> vary a lot depending on how good your compiler is at optimization.

Absolutely. Compile FFTW with gcc on a Sun and you'll get half the
speed of FFTW using Sun cc.

> For instance, compiled FFTW code is far from optimal with MSVC++ 6. This
> compiler doesn't fully use the FPU stack like an ASM programmer could do and
> I don't know why since I'm sure that writing a compiler that would make a
> good usage of the FPU registers is far from impossible.
> 
> So, the compiler you use to compile FFTW is a major factor for the
> performance you'll get from it.
> 
> I don't know if someone have done similar experiences and if there is a
> better compiler than MSVC for intensive FP code.

In my (admittedly limited) experience, MSVC produces pretty suboptimal
FPU code. gcc for DOS (the djgpp compiler) runs some of my FPU intensive
programs twice as fast as VC++ (for the *same* program). djgpp is nice
because if you write your floating point C a certain way, the compiler
will produce almost identical assembly code. This can be put to good
use if you can write asm yourself.

Another gripe I have about VC++ is that it's pretty good at using
integer registers so that stalls are avoided (for e.g. the Pentium),
but if you try to do anything even remotely complicated it hops to
a function call and destroys performance. For example, when working
with 64-bit integers gcc will recognize a shift by 32 and inline
simple code for it, where VC++ will jump to a function that will use
variable shifts (the call and shifts together take about 20x the time).
Actually, gcc's long long primitives are *way* faster than __int64
stuff on Microsoft's compiler.

jasonp

_________________________________________________________________
Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
Mersenne Prime FAQ      -- http://www.tasam.com/~lrwiman/FAQ-mers

Reply via email to