This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Newbie Questions about Optimization


> 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                        |
                                                          |


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]