Gentoo Archives: gentoo-user

From: Daniel Pielmeier <daniel.pielmeier@××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] gcc 4.2 and Core 2 Duo
Date: Fri, 20 Jul 2007 18:31:58
Message-Id: 46A0FDC8.9000204@googlemail.com
In Reply to: [gentoo-user] gcc 4.2 and Core 2 Duo by Andrew Gaydenko
1 Andrew Gaydenko schrieb:
2 > I have noticed, the official portage tree has included gcc 4.2. Now for
3 > Core 2 Duo CPU (amd64 Gentoo arch) I use in make.conf file:
4 >
5 > CFLAGS="-O2 -march=nocona -pipe"
6 >
7 > gcc' changelog has this note:
8 >
9 > --------------------
10 > ...
11 > IA-32/x86-64
12 >
13 > * -mtune=generic can now be used to generate code running well on common x86 chips.
14 > This includes AMD Athlon, AMD Opteron, Intel Pentium-M, Intel Pentium 4 and Intel
15 > Core 2.
16 > * -mtune=native and -march=native will produce code optimized for the host
17 > architecture as detected using the cpuid instruction.
18 > ...
19 > --------------------
20 >
21 > The question is: must I replace '-march=nocona' with '-mtune=native and -march=native'?
22
23 Here you will find additional information http://tinyurl.com/2b6spk.
24 It is stated there that you can use either -march=cpu-type or
25 -mtune=cpu-type and that -march=cpu-type implies -mtune=cpu-type.
26
27 I think you can also use the nocona option for the cpu-type until gcc
28 4.3 is out which brings you -march=core2, see here http://tinyurl.com/ottvh.
29
30 Using mtune or march depends on where you want to use your compiled
31 software, if you only want to use it only on your own machine
32 -march=native is probably the best option and if you want to use it on
33 other machines too, you should choose -mtune=native. If you don't know
34 at all the weather the cpu is IA32 AMD64 or EM64T you should use
35 -mtune=generic.
36
37 Maybe someone could explain it better, but this is what i understand!
38
39 Regards,
40
41 Daniel
42 --
43 gentoo-user@g.o mailing list