public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Newbie Questions about Optimization
@ 1997-12-03 19:52 meissner
  0 siblings, 0 replies; 3+ messages in thread
From: meissner @ 1997-12-03 19:52 UTC (permalink / raw)
  To: pcg, ronis; +Cc: egcs

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Newbie Questions about Optimization
  1997-12-03 15:32 David Ronis
@ 1997-12-03 18:08 ` Marc Lehmann
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Lehmann @ 1997-12-03 18:08 UTC (permalink / raw)
  To: David Ronis; +Cc: egcs

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Newbie Questions about Optimization
@ 1997-12-03 15:32 David Ronis
  1997-12-03 18:08 ` Marc Lehmann
  0 siblings, 1 reply; 3+ messages in thread
From: David Ronis @ 1997-12-03 15:32 UTC (permalink / raw)
  To: egcs

I just downloaded and compiled the egcs-1.0 release package on my linux box 
(2.0.29 version of the kernel).  It compiled fine and seems to work.

Several questions about optimization come to mind:

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
	
In particular, 	are higher -O levels supported?  [They don't appear to be
according to the info files].  Also,  are the various alignment options
necessary or are they implied by the -march=pentium flag?


2.  If I understood the info page correctly, -march=pentium means that the
code will only run on a pentium.


Thanks in advance.


David Ronis


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-12-03 19:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-03 19:52 Newbie Questions about Optimization meissner
  -- strict thread matches above, loose matches on Subject: below --
1997-12-03 15:32 David Ronis
1997-12-03 18:08 ` Marc Lehmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).