Optimisation

Chris Gianelloni twi at faradic.net
Wed Sep 6 08:53:56 PDT 2000


Christian wrote:

> On Wed, 6 Sep 2000, Keith Shapiro wrote:
>
> > > I have been attempting to build a very highly optimised system (-O6
> > > -march=i686 -mcpu=i686) using pgcc-2.95.3.  My problem is this:  When I
> >
> > Be aware that with gcc-2.95.2 (so more than likely pgcc) that the i686
> > architecture is Pentium Pro only, NOT Pentium 2/3.  Try using "-march=i586
> > -mcpu=i586" instead.
>
> Mmh, I used "-O3 -mcpu=pentiumpro -march=pentiumpro" on almost everything
> I build. It works fine although I've got a Pentium II machine. Is there
> any difference between the i686 and pentiumpro options?
>
> Christian

the i686 is identical to the pentiumpro option.  It even says so both in GCC
and PGCC docs.  The optimisation for "Pentium Pro" allows GCC to write code
that is better optimised for the core.  The basic core between a Pentium
Pro/II/III hasn't changed too much.  They have only added new features (MMX for
the II and SSE for the III) which extend the core.  My GLIBC was compiled with
gcc 2.95.2 and only uses the "-O2 -march=i686" optimisations.  It works
perfectly fine.  My problem was optimisation during the dynamic bash (YMMV).
In fact, my system is now a compete LFS 2.4 system.  The only modifications
from the book are the kernel (patched quite a bit for security) and my use of
pgcc instead of gcc.

If your system is a Pentium Pro/II/III you should have no problems at all in
using "-mcpu=i686 -march=i686".  The difference is going to come into what
optimisation level you use.  -O6 worked for me on several packages (including
shadow utils) but -O3 wouldn't even work on bash (had to go -O2).  Gerard was
able to compile *everything* using -O3, so once again, it depends on your
hardware.

I would like to thank everyone who helped me out on this, as before now I
really didn't have much of an understanding of exactly what the optimisations
did.

Check out http://www.goof.com/pcg/pgcc-faq.html#opts
for more info on optimisation.






More information about the lfs-dev mailing list