Compiling for CPU (was Re: Performance testing (pass 1))

Jakub Jelinek jakub at redhat.com
Sat Sep 27 08:20:12 UTC 2003


On Fri, Sep 26, 2003 at 09:42:09AM -0700, Rick Johnson wrote:
> Not to pit distros, but Mandrake compiles for i586 by default, though 
> they don't really give out any i686 or athlon specific packages (last I 
> checked). Given that Red Hat's minimum specd hardware is a Pentium class 

This is not true.
mdk compiles by default -march=i586 -mcpu=pentiumpro
and we by default -march=i386 -mcpu=i686
There are no real differences between the two, other than psychological
(if I remember well, the difference was in expansion of one math builtin
or something like that, I'd have to check). i586 ISA has of course
some instructions which are not in i386 ISA, but those are not used by GCC.
The important switch in both is -mcpu=i686, ie. all code in both distros is
optimized for pentiumpro and later.

We provide i686 (-march=i686 -mcpu=i686) versions of glibc, openssl, kernel.
Also, some program detect CPUs at runtime and contitionally use performance
critical code optimized for the current CPU (stuff like SSE, SSE2, etc.).
I don't think you'd be able to measure any difference on things like XFree86
libs, maybe XFree86 server. You can try, report the results here and maybe
it gets changed if it is a clear win.

	Jakub





More information about the test mailing list