public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Default ix86_arch = i386
@ 2002-07-09  5:07 Greg Schafer
  2002-07-09 11:16 ` Kelley Cook
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Schafer @ 2002-07-09  5:07 UTC (permalink / raw)
  To: gcc

Hello gcc developers!

Just wondering why gcc-3.1 defaults the ix86_arch to
"i386" when the old gcc-2.95.x defaulted to "i586" ?

Can anyone shed any light on the change and what the
reasoning was? It looks like the change dates back as
far as Sept' 99

Thanks to everyone working on gcc.

Greg

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

* Re: Default ix86_arch = i386
  2002-07-09  5:07 Default ix86_arch = i386 Greg Schafer
@ 2002-07-09 11:16 ` Kelley Cook
  2002-07-10  4:29   ` Greg Schafer
  0 siblings, 1 reply; 3+ messages in thread
From: Kelley Cook @ 2002-07-09 11:16 UTC (permalink / raw)
  To: Greg Schafer, gcc

Greg Schafer said:
>Hello gcc developers!
>
>Just wondering why gcc-3.1 defaults the ix86_arch to
>"i386" when the old gcc-2.95.x defaulted to "i586" ?
>
>Can anyone shed any light on the change and what the
>reasoning was? It looks like the change dates back as
>far as Sept' 99
>
>Thanks to everyone working on gcc.
>
>Greg

It actually hasn't changed...

For ia32 builds, the spec file that is created will contain a line
cpp_cpu_default: which will specify a default target tuning code. This default
will depend on whichever the target-triple gcc was configured with when you
built it.

When building gcc, if you don't specify a target-triple on the command line then
it defaults to whatever config.guess reports.  Under linux, config.guess grabs
the output from uname -m.  So if, for example, your linux kernel was compiled
using i386 (which is how most precompiled kernels come) then a gcc built under
it would default to i386.  If it was was optimized for an athlon then gcc would
default to creating code optimized for an athlon.

With post 2.95.x versions of gcc, "gcc -v" will tell you what target triple gcc
was configured  with.

Note that no matter which system you built the compiler with, unless you
manually supply an -march= line (or change the specs file to always do so), gcc
will default to creating a binary that will run on an i386 (though the
instructions will be optimally scheduled for whatever the target-triple says)
and therefore will not use newer instructions, such as the useful CMOVcc family
which was introduced with the PentiumPro.

HTH,
Kelley Cook


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

* Re: Default ix86_arch = i386
  2002-07-09 11:16 ` Kelley Cook
@ 2002-07-10  4:29   ` Greg Schafer
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Schafer @ 2002-07-10  4:29 UTC (permalink / raw)
  To: Kelley Cook; +Cc: gcc

On Tue, Jul 09, 2002 at 12:03:17PM -0400, Kelley Cook wrote:
> Note that no matter which system you built the compiler with, unless you
> manually supply an -march= line (or change the specs file to always do so), gcc
> will default to creating a binary that will run on an i386 (though the
> instructions will be optimally scheduled for whatever the target-triple says)
> and therefore will not use newer instructions, such as the useful CMOVcc family
> which was introduced with the PentiumPro.

Thanks for the reply Kelley.

However, I'm quite sure it actually has changed. Consider the
following snippet from "gcc/gcc/config/i386/i386.c" taken from
the gcc-2.95 branch:-

  if (ix86_arch_string == 0)
    {
      ix86_arch_string = PROCESSOR_PENTIUM_STRING;
      if (ix86_cpu_string == 0)
        ix86_cpu_string = PROCESSOR_DEFAULT_STRING;
    }

It clearly states that the default arch is equivalent to i586.

Now consider the same thing from gcc-3.1 and it looks like:-

  if (!ix86_cpu_string && ix86_arch_string)
    ix86_cpu_string = ix86_arch_string;
  if (!ix86_cpu_string)
    ix86_cpu_string = cpu_names [TARGET_CPU_DEFAULT];
  if (!ix86_arch_string)
    ix86_arch_string = TARGET_64BIT ? "athlon-4" : "i386";

It now clearly defaults to i386. My suspicions are confirmed
by running a simple test under each version of the compiler.

gcc -S -fverbose-asm hello.c

The output backs up my observation that gcc-2.95.x outputs
code generated with -march=pentium by default whereas gcc-3.1
outputs code generated with -march=i386 by default.

Anyway, its no biggie. I was just curious as to why the gcc
developers made the change. But I suppose it actually makes
sense to default to the lowest common denominator. (but
i386's are bloody old these days :-)

Greg

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

end of thread, other threads:[~2002-07-10  1:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-09  5:07 Default ix86_arch = i386 Greg Schafer
2002-07-09 11:16 ` Kelley Cook
2002-07-10  4:29   ` Greg Schafer

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