public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* March=native with a main 64bit system and 32bit chroot
@ 2009-05-26 15:41 Luca Zorzo
  2009-05-27  5:03 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Luca Zorzo @ 2009-05-26 15:41 UTC (permalink / raw)
  To: gcc

Hi all,
I've a main Gentoo 64bit system with CHOST="x86_64-pc-linux-gnu" and
CFLAGS="-march=native -mtune=native -O2 -pipe -fomit-frame-pointer".
My cpu is a Pentium 4 Prescott and i'm using gcc-4.3.2.

With this little script:
"echo 'float x(float x){return x < 0 ? -x : x;}' > x.c && gcc
-fverbose-asm -mtune=native -march=native -S x.c && grep
'\(-march\|-mtune\)' x.s && rm -fr x.c && rm -fr x.s "
i've found that gcc uses march=nocona and mtune=nocona, and this is ok.

In this main system i've some 32bit chroots with
CHOST="i686-pc-linux-gnu" and CFLAGS="-march=native -mtune=native -O2
-pipe -fomit-frame-pointer".
But this time gcc is using march=nocona and mtune=nocona again, that
is wrong i think.

Should i use march=native or march=prescott (that is what i was using
with old gcc versions) for my chroots?

If march=prescott is the right choice i think that the gcc "native"
detection should consider also $CHOST.

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

* Re: March=native with a main 64bit system and 32bit chroot
  2009-05-26 15:41 March=native with a main 64bit system and 32bit chroot Luca Zorzo
@ 2009-05-27  5:03 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2009-05-27  5:03 UTC (permalink / raw)
  To: Luca Zorzo; +Cc: gcc

Luca Zorzo <lucazorzo@gmail.com> writes:

> I've a main Gentoo 64bit system with CHOST="x86_64-pc-linux-gnu" and
> CFLAGS="-march=native -mtune=native -O2 -pipe -fomit-frame-pointer".
> My cpu is a Pentium 4 Prescott and i'm using gcc-4.3.2.
>
> With this little script:
> "echo 'float x(float x){return x < 0 ? -x : x;}' > x.c && gcc
> -fverbose-asm -mtune=native -march=native -S x.c && grep
> '\(-march\|-mtune\)' x.s && rm -fr x.c && rm -fr x.s "
> i've found that gcc uses march=nocona and mtune=nocona, and this is ok.
>
> In this main system i've some 32bit chroots with
> CHOST="i686-pc-linux-gnu" and CFLAGS="-march=native -mtune=native -O2
> -pipe -fomit-frame-pointer".
> But this time gcc is using march=nocona and mtune=nocona again, that
> is wrong i think.
>
> Should i use march=native or march=prescott (that is what i was using
> with old gcc versions) for my chroots?
>
> If march=prescott is the right choice i think that the gcc "native"
> detection should consider also $CHOST.

This question is appropriate for the mailing list gcc-help@gcc.gnu.org,
not the mailing list gcc@gcc.gnu.org.  Please take any followups to
gcc-help.  Thanks.

Your CPU is the same whether you have a chroot or not, and whether you
are running in 32-bit mode or in 64-bit mode, so it is correct for gcc
to handle -mtune=native -march=native the same way in both cases.
Naturally the -march option will be affected by whether you are in
32-bit mode or not.  As far as I know the -mtune option doesn't make any
difference.

It's reasonable to ask whether -mtune=nocona gives the best results when
using a Prescott.  Right now -mtune=prescott and -mtune=nocona are
handled identically in any case.  I don't know if there is room for
improvement there or not.

Ian

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

end of thread, other threads:[~2009-05-26 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-26 15:41 March=native with a main 64bit system and 32bit chroot Luca Zorzo
2009-05-27  5:03 ` Ian Lance Taylor

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