Newbie Questions about Optimization
Marc Lehmann
pcg@goof.com
Wed Dec 3 18:08:00 GMT 1997
> 1. is the set of flags that should get the most aggressive optimization:
>
> -O3 -march=pentium -ffast-math -funroll-loops -malign-double
> -malign-loops=2 -malign-jumps=2 -malign-functions=2
You could also give -mno-ieee and -funroll-all-loops a try.
And for pentiums, use -malign-*=0, for ppros use -malign-*=4
> In particular, are higher -O levels supported? [They don't appear to be
yes.. but -O6 -O69 etc.. are only counted as -O3
> according to the info files]. Also, are the various alignment options
> necessary or are they implied by the -march=pentium flag?
They should be implied, but an alignment of 2 for pentiums is not good.
> 2. If I understood the info page correctly, -march=pentium means that the
> code will only run on a pentium.
no.. in theory, -arch=xxx means use xxx-specific instructions,
but there are no pentium-specific instructions, so the code will
run on 486 and below.
the ppro, on the other hand, HAS new instructions, so -march=pentiumpro
*will* generate code that sometimes won't run on on pentiums and below.
-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg@goof.com |e|
-=====/_/_//_/\_,_/ /_/\_\ --+
The choice of a GNU generation |
|
More information about the Gcc
mailing list