Gentoo Archives: gentoo-user

From: Kfir Lavi <lavi.kfir@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] CFlags for CPU
Date: Thu, 28 Jul 2011 09:42:12
Message-Id: CAHNvW1JqxjohO-83jmM4T50d4dwfd_AFw2QkD7+Cj=DR2R_C=A@mail.gmail.com
In Reply to: Re: [gentoo-user] CFlags for CPU by Mick
1 On Wed, Jul 27, 2011 at 9:32 PM, Mick <michaelkintzios@×××××.com> wrote:
2
3 > On Wednesday 27 Jul 2011 17:13:21 Kfir Lavi wrote:
4 > > On Wed, Jul 27, 2011 at 5:34 PM, Kfir Lavi <lavi.kfir@×××××.com> wrote:
5 > > > On Wed, Jul 27, 2011 at 5:09 PM, Andy Wilkinson
6 > > >>
7 > > >> Another good trick I've found on the forums is to run:
8 > > >> $ gcc -### -e -v -march=native /usr/include/stdlib.h
9 > > >>
10 > > >> The last line of output will include the various CFLAGS that
11 > > >> -march=native
12 > > >>
13 > > >> picks. In my case (Phenom II 955):
14 > > >> "/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1" "-quiet"
15 > > >>
16 > > >> "/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=2" *"-march=amdfam10"
17 > > >> "-mcx16" "-msahf" "-mpopcnt"* "--param" "l1-cache-size=64" "--param"
18 > > >> "l1-cache-line-size=64" "--param" "l2-cache-size=512"
19 > "-mtune=amdfam10"
20 > > >> "-quiet" "-dumpbase" "stdlib.h" "-auxbase" "stdlib" "-o"
21 > > >> "/tmp/ccR1PlNZ.s" "--output-pch=/usr/include/stdlib.h.gch"
22 > > >>
23 > > >> I typically use -march=native when I don't need to worry about distcc,
24 > > >> or the options from that output that start with "-m".
25 >
26 > > Just shared this trick in my blog.
27 > >
28 > http://gentoo-what-did-you-say.blogspot.com/2011/07/finding-cpu-flags-using
29 > > -gcc.html I added a link to this thread in the post.
30 >
31 > It seems that on my early i7, the -march=core2 does not have all the -msse*
32 > flags enabled, while native does:
33 >
34 > $ diff -y --suppress-common-lines core2.txt native.txt
35 > -mcx16 [disabled] | -mcx16 [enabled]
36 > -mno-sse4 [enabled] | -mno-sse4 [disabled]
37 > -mpopcnt [disabled] | -mpopcnt [enabled]
38 > -msahf [disabled] | -msahf [enabled]
39 > -msse [disabled] | -msse [enabled]
40 > -msse2 [disabled] | -msse2 [enabled]
41 > -msse3 [disabled] | -msse3 [enabled]
42 > -msse4 [disabled] | -msse4 [enabled]
43 > -msse4.1 [disabled] | -msse4.1 [enabled]
44 > -msse4.2 [disabled] | -msse4.2 [enabled]
45 > -mssse3 [disabled] | -mssse3 [enabled]
46 > -mtune= | -mtune= core2
47 >
48 >
49 > I wonder if I should just set it to "-march=native -O2 -pipe" and forget
50 > about
51 > it ... native it seems to have more stuff switched on and it would probably
52 > be
53 > a-good-thing® (although my understanding of what each flag does is rather
54 > cursory).
55 > --
56 > Regards,
57 > Mick
58 >
59
60 My guess is that -msse4.2 imply also -msse1..4.1
61 Can someone confirm this?
62
63 Regards,
64 Kfir

Replies

Subject Author
Re: [gentoo-user] CFlags for CPU Helmut Jarausch <jarausch@××××××××××××××××.de>