Gentoo Archives: gentoo-amd64

From: Paul de Vrieze <pauldv@g.o>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] CFLAGS for Core2?
Date: Thu, 21 Sep 2006 18:42:46
Message-Id: 200609212038.03821.pauldv@gentoo.org
In Reply to: [gentoo-amd64] CFLAGS for Core2? by Jack Lloyd
1 On Wednesday 20 September 2006 22:25, Jack Lloyd wrote:
2 > Tomorrow my new Core 2 workstation should be arriving, and reading
3 > through the 2006.1 amd64 install notes and so forth, the recomended
4 > CFLAGS for EM64T CPUs is -march=nocona. However as that is tuned for
5 > 64-bit enabled Netburst rather than Conroe, I'm wondering if anyone
6 > had thoughts on good flags. In particular as (to the extent that I
7 > know anything about microarchitecture), Conroe seems closer to a K8
8 > than a P4, especially with regards to pipeline length and execution
9 > resources, I'm not sure that P4/Netburst tuning is the right thing to
10 > do. But the GCC docs say that -march=k8 enables 3dnow, which Intel
11 > chips don't have. So, right now the "seems likely" options would
12 > be:
13 >
14 > -march=k8 -mno-3dnow -msse3
15 > -march=nocona
16 > -march=pentium-m -m64 [saw this suggested in the forums, seems like a bad
17 > idea]
18 >
19 > Or can I get away with just something like
20 >
21 > -mtune=k8 -msse3 (will this get me 64-bit code?)
22 >
23 > To be clear, my main goals here are a) enable generation of all
24 > instructions the CPU has, b) keep GCC from generating 3dnow,etc
25 > instructions, and c) get instruction scheduling that is at least
26 > moderately decent for the uarch I'm using.
27 >
28 > Since SSE/SSE2, -mfpmath=sse, and argument passing via registers are
29 > default in 64-bit mode, I suspect the only other options I might try
30 > are -momit-leaf-frame-pointer, -frename-registers, and
31 > -finline-functions.
32 >
33 Be aware that -march and -mtune can be used together. This means that you
34 use -march=nocona to specify that such code must be generated, but you can
35 try different options for -mtune that only influences code scheduling and
36 which of alternate code options is chosen.
37
38 Paul
39
40 --
41 Paul de Vrieze
42 Gentoo Developer
43 Mail: pauldv@g.o
44 Homepage: http://www.devrieze.net