autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: target triplet


From: Brian Dessent
Subject: Re: target triplet
Date: Sat, 23 Dec 2006 17:03:48 -0800

Bob Rossi wrote:

> I know the target triplet is the cpu-vendor-os triplet where the
> executable runs. Does changing the cpu from i386-pc-mingw32 to
> i686-pc-mingw32 actually change executable that is created? Does gcc get
> special options to tell it to optimize for a particular CPU?

I'm pretty sure it has zero effect.  Gcc goes by what you specify with
-march (which used to be spelled -mcpu but that is deprecated now) and
-mtune.  See the manual for more details, as there are other options
related to handling of floating point and SIMD instructions as well.

Note that you can "bake in" a given setting of -march or -mtune when
building gcc by specifying --with-arch= and/or --with-tune to gcc, so if
you want a gcc that targets a given processor by default that is the way
to do it, not by changing the target triplet.

If you do not specify an -march during compilation and your gcc wasn't
configured --with-arch= then you get the i386 instruction set.

I think what you are really hitting on is the notion that target
triplets can be canonical or non-canonical.  You will see people use
anything from just "mingw32" to "i386-mingw32", "i586-mingw32",
"i686-pc-mingw32" and so on when referring to the MinGW target.  These
are all equally valid, as most configure scripts use one or more globs
along the lines of "*-mingw32*", "*mingw*", "i[3456789]86-*-mingw32*",
etc. to match against the triplet and so all of the above examples
should match.

So this idea of the host or target triplet is kind of a freeform field,
but with certain conventions.  This is also why you probably won't ever
see a definitive list of all gcc targets anywhere, unless you perhaps
processed the results of some mailing list like gcc-testresults where
people post the results of running the dejagnu testsuite.

Now as far as canonical vs. non-canonical, I could be wrong here but I
think the output of "config.guess" when run on any given host is its
canonical host triplet.  Somehow config.sub works into this process, it
might be called from config.guess, but I'm not sure of the details.  But
as above, that doesn't mean that specifying a non-canonical form won't
also work equally well, as long as it meets the existing conventions
that are in use in the various autoconf scripts in terms of globs that
match targets.

> If not, does anyone know where the correct place to ask about cpu
> specific gcc optimizations would be?

The gcc-help mailing list, I'd say.

Brian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]