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


| > In particular, 	are higher -O levels supported?  [They don't appear to be
| 
| yes.. but -O6 -O69 etc.. are only counted as -O3

Yes, this is one of the problems with Intel's original pentium patches and why
they were not accepted at the FSF (there were ctually much larger problems) --
Intel redefined the optimization levels.

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

To be more precise, there are no pentium specific instructions that the
compiler generates (wrmsr, rdtsc, rdmsr, and cmpxchg8b are not avilable on any
486, and cpuid was not available on most 486s, but the later models did support
it).  Similarly, the 486 added bswap, xadd, cmpxchg, invd, wbinvd, and invlpg.

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

Basically the cmov* and fcmov* instructions, which are conditional move
instructions.


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