public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* -mtune != -march (>=) - optimizing for a higher architecture
@ 2004-09-25 11:44 Tom Alsberg
  2004-09-25 14:56 ` Paul Brook
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Alsberg @ 2004-09-25 11:44 UTC (permalink / raw)
  To: GCC Mailing List

Hi there...

Recently I built GCC 3.4.2 for Linux, and read through a bit of its
documentation.  In (gcc.info)i386 and x86-63 Options, it is said under
`-march=CPU-TYPE':  specifying `-march=CPU-TYPE' implies 
`-mtune=CPU-TYPE'.

I wonder, then - how could I compile code that would be optimized for
one x86 CPU family member (say, pentium3), but that would run on all
x86 CPUs since some older one (say, i586), and fully take advantage of
that older (but still newer than i386) one's instruction and register 
set, etc?

For example, how could I compile code to take advantage, of, say,
pentium instructions and registers, but optimize instruction 
scheduling, cache and pipeline usage, etc. for, say, pentium3?

I used to compile code specifying -mcpu=pentiumpro -march=pentium,
believing that this would make it optimized for the i686 but would
run on and take advantage of i586 instructions...

If I understand correctly now, only specifying -mtune will generate
code that will run on i386 (and thus not take advantage of newer 
instructions, etc.), but be optimized for some newer CPU-TYPE...

But I'm not sure how to take the lower limit somewhat higher than the
i386, while still optimizing for something yet newer than that...

I'm sorry if that's a FAQ or some misunderstanding of me...  I couldn't
find any answer, though, and didn't feel like going through the source
of GCC...

  Thanks,
  -- Tom

-- 
  Tom Alsberg - hacker (being the best description fitting this space)
  Web page:	http://www.cs.huji.ac.il/~alsbergt/
DISCLAIMER:  The above message does not even necessarily represent what
my fingers have typed on the keyboard, save anything further.

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

end of thread, other threads:[~2004-09-25 19:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-25 11:44 -mtune != -march (>=) - optimizing for a higher architecture Tom Alsberg
2004-09-25 14:56 ` Paul Brook
2004-09-25 19:37   ` Tom Alsberg
2004-09-25 21:50     ` Reducing the size of the binaries Juan Ignacio Garzón
2004-09-25 21:51       ` Kevin Puetz
2004-09-25 21:51       ` Oscar Fuentes

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