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]
Other format: [Raw text]

Re: Default ix86_arch = i386


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



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