* [gentoo-amd64] CFLAGS for Intel Core2 CPUs
@ 2006-12-10 8:01 Michael Weyershäuser
0 siblings, 0 replies; only message in thread
From: Michael Weyershäuser @ 2006-12-10 8:01 UTC (permalink / raw
To: gentoo-amd64
[-- Attachment #1: Type: text/plain, Size: 2376 bytes --]
The question has been asked several times and answered with different
suggestions:
"What CFLAGS should I use for an Intel Core2 CPU?"
It has been answered a few days ago by dirtyepic on his blog with the
information coming straight from Intel:
> GCC and Intel Core
> Thanks to H.J. Lu at Intel, I finally got an answer to something that's been bugging me for a while now. What CFLAGS do you use with an Intel Core or Core 2 processor? -march=pentium-m, or -march=prescott/nocona?
>
> On Fri, Dec 01, 2006 at 06:43:46AM -0800, H. J. Lu wrote:
> > On Fri, Dec 01, 2006 at 03:36:59AM -0600, Ryan Hill wrote:
> > > So anyways, should -m{arch,tune}=native be setting pentium-m for Core
> > > CPU's, or is prescott really the better choice in the end?
> >
> > It should be -march=prescott -mtune=generic. I will look into it.
>
> I opened
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30040
>
>
> H.J.
>
>
>
> So, final answer. If you're using GCC 4.1, use -march=prescott for Intel Core Solo/Duo and -march=nocona (and an amd64 profile) for Core 2 Solo/Duo. For GCC 4.2, a Core Solo/Duo should use -march=prescott -mtune=generic, and Core 2 Solo/Duo should be set to -march=nocona -mtune=generic. GCC trunk adds -march=core2 and support for the SSSE3 instruction set, but that won't be out for quite a while yet.
>
> If you do happen to be using GCC 4.2, check out the very cool -march=native, which will autodetect the host processor(s) and set -march and -mtune accordingly. For Core CPU's you'll also need the patch from GCC PR #30040.
>
> dirtyepic@tycho ~ $ cat /proc/cpuinfo | grep name
> model name : Genuine Intel(R) CPU T2300 @ 1.66GHz
> model name : Genuine Intel(R) CPU T2300 @ 1.66GHz
> dirtyepic@tycho ~ $ gcc -v -c test.c -o test -O2 -march=native
> [...]
> gcc version 4.2.0-pre20061203 (prerelease) (rev. 119470)
> /usr/libexec/gcc/i686-pc-linux-gnu/4.2.0-pre20061203/cc1 -quiet -v test.c -march=prescott -mtune=generic -quiet -dumpbase test.c -auxbase-strip test -O2 -version -o /tmp/cclzri4i.s
>
>
>
> You can find the backported patch here:
> http://dev.gentoo.org/~dirtyepic/overlay/sys-devel/gcc/files/4.2.0/gcc-4.2-pr30040-mtune-native-core-duo.patch
His original post can be found here:
http://psykil.livejournal.com/2006/12/03/
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-12-10 8:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-10 8:01 [gentoo-amd64] CFLAGS for Intel Core2 CPUs Michael Weyershäuser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox