* [gentoo-user] CFlags for CPU
@ 2011-07-26 20:36 Alokat
2011-07-26 18:58 ` Michael Mol
` (4 more replies)
0 siblings, 5 replies; 22+ messages in thread
From: Alokat @ 2011-07-26 20:36 UTC (permalink / raw
To: Gentoo mailing list
[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]
Hi folks,
I'm wondering what kind of cpu-type I should use?
cat /proc/cpuinfo
..............
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Duo CPU L7100 @ 1.20GHz
stepping : 11
cpu MHz : 1197.065
cache size : 4096 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl
aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm
lahf_lm ida dts tpr_shadow vnmi flexpriority
bogomips : 2394.01
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
..............
After a short research on this website:
http://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
I guess *core2* is the right one?
Is that true?
Regards,
alokat
//
[-- Attachment #2: Type: text/html, Size: 2686 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-26 20:36 [gentoo-user] CFlags for CPU Alokat
@ 2011-07-26 18:58 ` Michael Mol
2011-07-27 0:58 ` Bill Kenworthy
2011-07-26 18:59 ` [gentoo-user] " Alan McKinnon
` (3 subsequent siblings)
4 siblings, 1 reply; 22+ messages in thread
From: Michael Mol @ 2011-07-26 18:58 UTC (permalink / raw
To: gentoo-user
On Tue, Jul 26, 2011 at 4:36 PM, Alokat <mailing@alokat.org> wrote:
> Hi folks,
>
> I'm wondering what kind of cpu-type I should use?
>
> cat /proc/cpuinfo
[snip]
> model name : Intel(R) Core(TM)2 Duo CPU L7100 @ 1.20GHz
[snip]
> ..............
>
> After a short research on this website:
> http://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
>
> I guess core2 is the right one?
> Is that true?
That should work fine. Or 'native', if you don't plan on playing with distcc.
--
:wq
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-26 18:58 ` Michael Mol
@ 2011-07-27 0:58 ` Bill Kenworthy
2011-07-27 3:08 ` [gentoo-user] " Nikos Chantziaras
0 siblings, 1 reply; 22+ messages in thread
From: Bill Kenworthy @ 2011-07-27 0:58 UTC (permalink / raw
To: gentoo-user
On Tue, 2011-07-26 at 14:58 -0400, Michael Mol wrote:
> On Tue, Jul 26, 2011 at 4:36 PM, Alokat <mailing@alokat.org> wrote:
> > Hi folks,
> >
> > I'm wondering what kind of cpu-type I should use?
> >
> > cat /proc/cpuinfo
> [snip]
> > model name : Intel(R) Core(TM)2 Duo CPU L7100 @ 1.20GHz
>
> [snip]
> > ..............
> >
> > After a short research on this website:
> > http://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
> >
> > I guess core2 is the right one?
> > Is that true?
>
> That should work fine. Or 'native', if you don't plan on playing with distcc.
>
moriah tuxonice-2.6.39 # gcc -Q --help=target -march=core2 >a
moriah tuxonice-2.6.39 # gcc -Q --help=target -march=native >b
moriah tuxonice-2.6.39 # diff a b
23c23
< -mcx16 [disabled]
---
> -mcx16 [enabled]
56c56
< -msahf [disabled]
---
> -msahf [enabled]
74c74
< -mtune=
---
> -mtune= core2
moriah tuxonice-2.6.39 #
I am now using core2 as I was having some really odd problems after
mixing flags after multiple hardware changes along with native. Core2
is recommended for this processor, and I cant see the two flags changed
via native making a difference, but the previous processors is no longer
available to check.
Perhaps someone could do the above and send me the result (the full "gcc
-Q --help=target -march=native", using gcc-4.5) for an intel E4600?
(the list probably wont be interested!)
BillK
^ permalink raw reply [flat|nested] 22+ messages in thread
* [gentoo-user] Re: CFlags for CPU
2011-07-27 0:58 ` Bill Kenworthy
@ 2011-07-27 3:08 ` Nikos Chantziaras
0 siblings, 0 replies; 22+ messages in thread
From: Nikos Chantziaras @ 2011-07-27 3:08 UTC (permalink / raw
To: gentoo-user
On 07/27/2011 03:58 AM, Bill Kenworthy wrote:
>
> I am now using core2 as I was having some really odd problems after
> mixing flags after multiple hardware changes along with native. Core2
> is recommended for this processor, and I cant see the two flags changed
> via native making a difference, but the previous processors is no longer
> available to check.
Different Core 2 CPUs support different features. There are, for
example, Core 2 CPUs that support SSE4 and other Core 2's don't. If you
have "native" on one that supports it and then try to run it on another
that doesn't, chances are it will crash, even if both CPUs are "Core 2".
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-26 20:36 [gentoo-user] CFlags for CPU Alokat
2011-07-26 18:58 ` Michael Mol
@ 2011-07-26 18:59 ` Alan McKinnon
2011-07-26 18:59 ` Mark Knecht
` (2 subsequent siblings)
4 siblings, 0 replies; 22+ messages in thread
From: Alan McKinnon @ 2011-07-26 18:59 UTC (permalink / raw
To: gentoo-user; +Cc: Alokat
On Tuesday 26 July 2011 20:36:14 Alokat did opine thusly:
> Hi folks,
>
> I'm wondering what kind of cpu-type I should use?
>
> cat /proc/cpuinfo
> ..............
>
> processor : 1
> vendor_id : GenuineIntel
> cpu family : 6
> model : 15
> model name : Intel(R) Core(TM)2 Duo CPU L7100 @ 1.20GHz
> stepping : 11
> cpu MHz : 1197.065
> cache size : 4096 KB
> physical id : 0
> siblings : 2
> core id : 1
> cpu cores : 2
> apicid : 1
> initial apicid : 1
> fpu : yes
> fpu_exception : yes
> cpuid level : 10
> wp : yes
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr
> pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
> pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl
> aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr
> pdcm lahf_lm ida dts tpr_shadow vnmi flexpriority
> bogomips : 2394.01
> clflush size : 64
> cache_alignment : 64
> address sizes : 36 bits physical, 48 bits virtual
> power management:
>
> ..............
>
> After a short research on this website:
> http://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/i386-and-x86_002d64-Opti
> ons.html#i386-and-x86_002d64-Options
>
> I guess *core2* is the right one?
> Is that true?
native?
--
alan dot mckinnon at gmail dot com
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-26 20:36 [gentoo-user] CFlags for CPU Alokat
2011-07-26 18:58 ` Michael Mol
2011-07-26 18:59 ` [gentoo-user] " Alan McKinnon
@ 2011-07-26 18:59 ` Mark Knecht
2011-07-26 19:02 ` Paul Hartman
2011-07-26 19:22 ` pk
4 siblings, 0 replies; 22+ messages in thread
From: Mark Knecht @ 2011-07-26 18:59 UTC (permalink / raw
To: gentoo-user
On Tue, Jul 26, 2011 at 1:36 PM, Alokat <mailing@alokat.org> wrote:
> Hi folks,
>
> I'm wondering what kind of cpu-type I should use?
>
> cat /proc/cpuinfo
> ..............
>
> processor : 1
> vendor_id : GenuineIntel
> cpu family : 6
> model : 15
> model name : Intel(R) Core(TM)2 Duo CPU L7100 @ 1.20GHz
> stepping : 11
> cpu MHz : 1197.065
> cache size : 4096 KB
> physical id : 0
> siblings : 2
> core id : 1
> cpu cores : 2
> apicid : 1
> initial apicid : 1
> fpu : yes
> fpu_exception : yes
> cpuid level : 10
> wp : yes
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
> cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm
> constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64
> monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida dts tpr_shadow
> vnmi flexpriority
> bogomips : 2394.01
> clflush size : 64
> cache_alignment : 64
> address sizes : 36 bits physical, 48 bits virtual
> power management:
>
> ..............
>
> After a short research on this website:
> http://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
>
> I guess core2 is the right one?
> Is that true?
>
> Regards,
> alokat
>
Or let gcc figure it out using
-march=native
which is what I eventually did:
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -march=native -pipe"
#Safe CFlags for the Core-i7 (web info) saved for reference
#CFLAGS="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
HTH,
Mark
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-26 20:36 [gentoo-user] CFlags for CPU Alokat
` (2 preceding siblings ...)
2011-07-26 18:59 ` Mark Knecht
@ 2011-07-26 19:02 ` Paul Hartman
2011-07-26 22:01 ` Mick
2011-07-26 19:22 ` pk
4 siblings, 1 reply; 22+ messages in thread
From: Paul Hartman @ 2011-07-26 19:02 UTC (permalink / raw
To: gentoo-user
On Tue, Jul 26, 2011 at 3:36 PM, Alokat <mailing@alokat.org> wrote:
> I'm wondering what kind of cpu-type I should use?
Hi,
I think, in your case, core2 is the correct one.
If you run this command:
gcc -Q --help=target -march=native
gcc will tell you what it thinks are the best options for your CPU.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-26 19:02 ` Paul Hartman
@ 2011-07-26 22:01 ` Mick
2011-07-26 22:15 ` Paul Hartman
0 siblings, 1 reply; 22+ messages in thread
From: Mick @ 2011-07-26 22:01 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 3993 bytes --]
On Tuesday 26 Jul 2011 20:02:05 Paul Hartman wrote:
> On Tue, Jul 26, 2011 at 3:36 PM, Alokat <mailing@alokat.org> wrote:
> > I'm wondering what kind of cpu-type I should use?
>
> Hi,
>
> I think, in your case, core2 is the correct one.
>
> If you run this command:
> gcc -Q --help=target -march=native
>
> gcc will tell you what it thinks are the best options for your CPU.
Thanks for this - I better make a note of it! ;-)
Does this mean that I did not need to have all these flags specified, because
they're already included?
CFLAGS="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe"
-msse4 -mcx16 -msahf seem to be already enabled:
====================================================
$ gcc -Q --help=target -march=native
The following options are target specific:
-m128bit-long-double [disabled]
-m32 [disabled]
-m3dnow [disabled]
-m3dnowa [disabled]
-m64 [enabled]
-m80387 [enabled]
-m96bit-long-double [enabled]
-mabm [disabled]
-maccumulate-outgoing-args [disabled]
-maes [disabled]
-malign-double [disabled]
-malign-functions=
-malign-jumps=
-malign-loops=
-malign-stringops [enabled]
-march= core2
-masm=
-mavx [disabled]
-mbranch-cost=
-mcld [disabled]
-mcmodel=
-mcx16 [enabled]
-mfancy-math-387 [enabled]
-mfma [disabled]
-mforce-drap [disabled]
-mfp-ret-in-387 [enabled]
-mfpmath=
-mfused-madd [enabled]
-mglibc [enabled]
-mhard-float [enabled]
-mieee-fp [enabled]
-mincoming-stack-boundary=
-minline-all-stringops [disabled]
-minline-stringops-dynamically [disabled]
-mintel-syntax [disabled]
-mlarge-data-threshold=
-mmmx [disabled]
-mms-bitfields [disabled]
-mno-align-stringops [disabled]
-mno-fancy-math-387 [disabled]
-mno-fused-madd [disabled]
-mno-push-args [disabled]
-mno-red-zone [disabled]
-mno-sse4 [disabled]
-momit-leaf-frame-pointer [disabled]
-mpc
-mpclmul [disabled]
-mpopcnt [enabled]
-mpreferred-stack-boundary=
-mpush-args [enabled]
-mrecip [disabled]
-mred-zone [enabled]
-mregparm=
-mrtd [disabled]
-msahf [enabled]
-msoft-float [disabled]
-msse [enabled]
-msse2 [enabled]
-msse2avx [disabled]
-msse3 [enabled]
-msse4 [enabled]
-msse4.1 [enabled]
-msse4.2 [enabled]
-msse4a [disabled]
-msse5 [disabled]
-msseregparm [disabled]
-mssse3 [enabled]
-mstack-arg-probe [disabled]
-mstackrealign [enabled]
-mstringop-strategy=
-mtls-dialect=
-mtls-direct-seg-refs [enabled]
-mtune= core2
-muclibc [disabled]
-mveclibabi=
====================================================
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-26 22:01 ` Mick
@ 2011-07-26 22:15 ` Paul Hartman
0 siblings, 0 replies; 22+ messages in thread
From: Paul Hartman @ 2011-07-26 22:15 UTC (permalink / raw
To: gentoo-user
On Tue, Jul 26, 2011 at 5:01 PM, Mick <michaelkintzios@gmail.com> wrote:
> On Tuesday 26 Jul 2011 20:02:05 Paul Hartman wrote:
>> On Tue, Jul 26, 2011 at 3:36 PM, Alokat <mailing@alokat.org> wrote:
>> > I'm wondering what kind of cpu-type I should use?
>>
>> Hi,
>>
>> I think, in your case, core2 is the correct one.
>>
>> If you run this command:
>> gcc -Q --help=target -march=native
>>
>> gcc will tell you what it thinks are the best options for your CPU.
>
> Thanks for this - I better make a note of it! ;-)
>
> Does this mean that I did not need to have all these flags specified, because
> they're already included?
Not quite; that command specifically shows you the options that would
be used if you were using -march=native. Since you're not using
native, change it to:
gcc -Q --help=target -march=core2
And that will show the defaults when you're using core2 as the arch.
(On my own system, a side-by-side comparison of native vs core2 shows
a lot of differences)
If native shows something as "enabled" but core2 doesn't, it should be
safe to add that option to your cflags because it's likely your CPU
can handle it just fine.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-26 20:36 [gentoo-user] CFlags for CPU Alokat
` (3 preceding siblings ...)
2011-07-26 19:02 ` Paul Hartman
@ 2011-07-26 19:22 ` pk
2011-07-27 14:09 ` Andy Wilkinson
4 siblings, 1 reply; 22+ messages in thread
From: pk @ 2011-07-26 19:22 UTC (permalink / raw
To: gentoo-user
On 2011-07-26 22:36, Alokat wrote:
> model name : Intel(R) Core(TM)2 Duo CPU L7100 @ 1.20GHz
<snip>
> I guess *core2* is the right one?
Yes, acc. to:
http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Core_2_Duo.2FQuad.2C_Xeon_51xx.2F53xx.2F54xx.2F3360.2C_Pentium_Dual-Core_T23xx.2B.2FExxxx.2C_Celeron_Dual-Core
HTH
Best regards
Peter K
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-26 19:22 ` pk
@ 2011-07-27 14:09 ` Andy Wilkinson
2011-07-27 14:34 ` Kfir Lavi
0 siblings, 1 reply; 22+ messages in thread
From: Andy Wilkinson @ 2011-07-27 14:09 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1143 bytes --]
On 07/26/2011 12:22 PM, pk wrote:
> On 2011-07-26 22:36, Alokat wrote:
>
>> model name : Intel(R) Core(TM)2 Duo CPU L7100 @ 1.20GHz
> <snip>
>
>> I guess *core2* is the right one?
> Yes, acc. to:
> http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Core_2_Duo.2FQuad.2C_Xeon_51xx.2F53xx.2F54xx.2F3360.2C_Pentium_Dual-Core_T23xx.2B.2FExxxx.2C_Celeron_Dual-Core
>
> HTH
>
> Best regards
>
> Peter K
>
Another good trick I've found on the forums is to run:
$ gcc -### -e -v -march=native /usr/include/stdlib.h
The last line of output will include the various CFLAGS that
-march=native picks. In my case (Phenom II 955):
"/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1" "-quiet"
"/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=2" *"-march=amdfam10"
"-mcx16" "-msahf" "-mpopcnt"* "--param" "l1-cache-size=64" "--param"
"l1-cache-line-size=64" "--param" "l2-cache-size=512" "-mtune=amdfam10"
"-quiet" "-dumpbase" "stdlib.h" "-auxbase" "stdlib" "-o"
"/tmp/ccR1PlNZ.s" "--output-pch=/usr/include/stdlib.h.gch"
I typically use -march=native when I don't need to worry about distcc,
or the options from that output that start with "-m".
-Andy
[-- Attachment #2: Type: text/html, Size: 2115 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-27 14:09 ` Andy Wilkinson
@ 2011-07-27 14:34 ` Kfir Lavi
2011-07-27 16:13 ` Kfir Lavi
0 siblings, 1 reply; 22+ messages in thread
From: Kfir Lavi @ 2011-07-27 14:34 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]
On Wed, Jul 27, 2011 at 5:09 PM, Andy Wilkinson <drukargin@gmail.com> wrote:
> **
> On 07/26/2011 12:22 PM, pk wrote:
>
> On 2011-07-26 22:36, Alokat wrote:
>
>
> model name : Intel(R) Core(TM)2 Duo CPU L7100 @ 1.20GHz
>
> <snip>
>
>
> I guess *core2* is the right one?
>
> Yes, acc. to:http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Core_2_Duo.2FQuad.2C_Xeon_51xx.2F53xx.2F54xx.2F3360.2C_Pentium_Dual-Core_T23xx.2B.2FExxxx.2C_Celeron_Dual-Core
>
> HTH
>
> Best regards
>
> Peter K
>
>
> Another good trick I've found on the forums is to run:
>
> $ gcc -### -e -v -march=native /usr/include/stdlib.h
>
> The last line of output will include the various CFLAGS that -march=native
> picks. In my case (Phenom II 955):
>
> "/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1" "-quiet"
> "/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=2" *"-march=amdfam10" "-mcx16"
> "-msahf" "-mpopcnt"* "--param" "l1-cache-size=64" "--param"
> "l1-cache-line-size=64" "--param" "l2-cache-size=512" "-mtune=amdfam10"
> "-quiet" "-dumpbase" "stdlib.h" "-auxbase" "stdlib" "-o" "/tmp/ccR1PlNZ.s"
> "--output-pch=/usr/include/stdlib.h.gch"
>
> I typically use -march=native when I don't need to worry about distcc, or
> the options from that output that start with "-m".
>
> -Andy
>
I must stay, this is brilliant !
Thank you very much.
Kfir
[-- Attachment #2: Type: text/html, Size: 2573 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-27 14:34 ` Kfir Lavi
@ 2011-07-27 16:13 ` Kfir Lavi
2011-07-27 18:32 ` Mick
0 siblings, 1 reply; 22+ messages in thread
From: Kfir Lavi @ 2011-07-27 16:13 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1632 bytes --]
On Wed, Jul 27, 2011 at 5:34 PM, Kfir Lavi <lavi.kfir@gmail.com> wrote:
>
>
> On Wed, Jul 27, 2011 at 5:09 PM, Andy Wilkinson <drukargin@gmail.com>wrote:
>
>> **
>> On 07/26/2011 12:22 PM, pk wrote:
>>
>> On 2011-07-26 22:36, Alokat wrote:
>>
>>
>> model name : Intel(R) Core(TM)2 Duo CPU L7100 @ 1.20GHz
>>
>> <snip>
>>
>>
>> I guess *core2* is the right one?
>>
>> Yes, acc. to:http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Core_2_Duo.2FQuad.2C_Xeon_51xx.2F53xx.2F54xx.2F3360.2C_Pentium_Dual-Core_T23xx.2B.2FExxxx.2C_Celeron_Dual-Core
>>
>> HTH
>>
>> Best regards
>>
>> Peter K
>>
>>
>> Another good trick I've found on the forums is to run:
>>
>> $ gcc -### -e -v -march=native /usr/include/stdlib.h
>>
>> The last line of output will include the various CFLAGS that -march=native
>> picks. In my case (Phenom II 955):
>>
>> "/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1" "-quiet"
>> "/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=2" *"-march=amdfam10" "-mcx16"
>> "-msahf" "-mpopcnt"* "--param" "l1-cache-size=64" "--param"
>> "l1-cache-line-size=64" "--param" "l2-cache-size=512" "-mtune=amdfam10"
>> "-quiet" "-dumpbase" "stdlib.h" "-auxbase" "stdlib" "-o" "/tmp/ccR1PlNZ.s"
>> "--output-pch=/usr/include/stdlib.h.gch"
>>
>> I typically use -march=native when I don't need to worry about distcc, or
>> the options from that output that start with "-m".
>>
>> -Andy
>>
> I must stay, this is brilliant !
> Thank you very much.
>
> Kfir
>
Just shared this trick in my blog.
http://gentoo-what-did-you-say.blogspot.com/2011/07/finding-cpu-flags-using-gcc.html
I added a link to this thread in the post.
Kfir
[-- Attachment #2: Type: text/html, Size: 3268 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-27 16:13 ` Kfir Lavi
@ 2011-07-27 18:32 ` Mick
2011-07-27 20:24 ` Mark Knecht
` (2 more replies)
0 siblings, 3 replies; 22+ messages in thread
From: Mick @ 2011-07-27 18:32 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 2420 bytes --]
On Wednesday 27 Jul 2011 17:13:21 Kfir Lavi wrote:
> On Wed, Jul 27, 2011 at 5:34 PM, Kfir Lavi <lavi.kfir@gmail.com> wrote:
> > On Wed, Jul 27, 2011 at 5:09 PM, Andy Wilkinson
> >>
> >> Another good trick I've found on the forums is to run:
> >> $ gcc -### -e -v -march=native /usr/include/stdlib.h
> >>
> >> The last line of output will include the various CFLAGS that
> >> -march=native
> >>
> >> picks. In my case (Phenom II 955):
> >> "/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1" "-quiet"
> >>
> >> "/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=2" *"-march=amdfam10"
> >> "-mcx16" "-msahf" "-mpopcnt"* "--param" "l1-cache-size=64" "--param"
> >> "l1-cache-line-size=64" "--param" "l2-cache-size=512" "-mtune=amdfam10"
> >> "-quiet" "-dumpbase" "stdlib.h" "-auxbase" "stdlib" "-o"
> >> "/tmp/ccR1PlNZ.s" "--output-pch=/usr/include/stdlib.h.gch"
> >>
> >> I typically use -march=native when I don't need to worry about distcc,
> >> or the options from that output that start with "-m".
> Just shared this trick in my blog.
> http://gentoo-what-did-you-say.blogspot.com/2011/07/finding-cpu-flags-using
> -gcc.html I added a link to this thread in the post.
It seems that on my early i7, the -march=core2 does not have all the -msse*
flags enabled, while native does:
$ diff -y --suppress-common-lines core2.txt native.txt
-mcx16 [disabled] | -mcx16 [enabled]
-mno-sse4 [enabled] | -mno-sse4 [disabled]
-mpopcnt [disabled] | -mpopcnt [enabled]
-msahf [disabled] | -msahf [enabled]
-msse [disabled] | -msse [enabled]
-msse2 [disabled] | -msse2 [enabled]
-msse3 [disabled] | -msse3 [enabled]
-msse4 [disabled] | -msse4 [enabled]
-msse4.1 [disabled] | -msse4.1 [enabled]
-msse4.2 [disabled] | -msse4.2 [enabled]
-mssse3 [disabled] | -mssse3 [enabled]
-mtune= | -mtune= core2
I wonder if I should just set it to "-march=native -O2 -pipe" and forget about
it ... native it seems to have more stuff switched on and it would probably be
a-good-thing® (although my understanding of what each flag does is rather
cursory).
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-27 18:32 ` Mick
@ 2011-07-27 20:24 ` Mark Knecht
2011-07-27 20:56 ` Mick
2011-07-27 21:11 ` pk
2011-07-28 9:40 ` Kfir Lavi
2 siblings, 1 reply; 22+ messages in thread
From: Mark Knecht @ 2011-07-27 20:24 UTC (permalink / raw
To: gentoo-user
On Wed, Jul 27, 2011 at 11:32 AM, Mick <michaelkintzios@gmail.com> wrote:
> On Wednesday 27 Jul 2011 17:13:21 Kfir Lavi wrote:
>> On Wed, Jul 27, 2011 at 5:34 PM, Kfir Lavi <lavi.kfir@gmail.com> wrote:
>> > On Wed, Jul 27, 2011 at 5:09 PM, Andy Wilkinson
>> >>
>> >> Another good trick I've found on the forums is to run:
>> >> $ gcc -### -e -v -march=native /usr/include/stdlib.h
>> >>
>> >> The last line of output will include the various CFLAGS that
>> >> -march=native
>> >>
>> >> picks. In my case (Phenom II 955):
>> >> "/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1" "-quiet"
>> >>
>> >> "/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=2" *"-march=amdfam10"
>> >> "-mcx16" "-msahf" "-mpopcnt"* "--param" "l1-cache-size=64" "--param"
>> >> "l1-cache-line-size=64" "--param" "l2-cache-size=512" "-mtune=amdfam10"
>> >> "-quiet" "-dumpbase" "stdlib.h" "-auxbase" "stdlib" "-o"
>> >> "/tmp/ccR1PlNZ.s" "--output-pch=/usr/include/stdlib.h.gch"
>> >>
>> >> I typically use -march=native when I don't need to worry about distcc,
>> >> or the options from that output that start with "-m".
>
>> Just shared this trick in my blog.
>> http://gentoo-what-did-you-say.blogspot.com/2011/07/finding-cpu-flags-using
>> -gcc.html I added a link to this thread in the post.
>
> It seems that on my early i7, the -march=core2 does not have all the -msse*
> flags enabled, while native does:
>
> $ diff -y --suppress-common-lines core2.txt native.txt
> -mcx16 [disabled] | -mcx16 [enabled]
> -mno-sse4 [enabled] | -mno-sse4 [disabled]
> -mpopcnt [disabled] | -mpopcnt [enabled]
> -msahf [disabled] | -msahf [enabled]
> -msse [disabled] | -msse [enabled]
> -msse2 [disabled] | -msse2 [enabled]
> -msse3 [disabled] | -msse3 [enabled]
> -msse4 [disabled] | -msse4 [enabled]
> -msse4.1 [disabled] | -msse4.1 [enabled]
> -msse4.2 [disabled] | -msse4.2 [enabled]
> -mssse3 [disabled] | -mssse3 [enabled]
> -mtune= | -mtune= core2
>
>
> I wonder if I should just set it to "-march=native -O2 -pipe" and forget about
> it ... native it seems to have more stuff switched on and it would probably be
> a-good-thing® (although my understanding of what each flag does is rather
> cursory).
> --
> Regards,
> Mick
>
Just curious if that's consistent with /proc/cpuinfo in the flags
section? MAybe gcc is wrong in it's enable/disable choices, or maybe
they know something specific.
This is from an i7-980 Extreme from about 1 year ago:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts
rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64
monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt
aes lahf_lm ida arat dts tpr_shadow vnmi flexpriority ept vpid
- Mark
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-27 20:24 ` Mark Knecht
@ 2011-07-27 20:56 ` Mick
0 siblings, 0 replies; 22+ messages in thread
From: Mick @ 2011-07-27 20:56 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 3805 bytes --]
On Wednesday 27 Jul 2011 21:24:33 Mark Knecht wrote:
> On Wed, Jul 27, 2011 at 11:32 AM, Mick <michaelkintzios@gmail.com> wrote:
> > On Wednesday 27 Jul 2011 17:13:21 Kfir Lavi wrote:
> >> On Wed, Jul 27, 2011 at 5:34 PM, Kfir Lavi <lavi.kfir@gmail.com> wrote:
> >> > On Wed, Jul 27, 2011 at 5:09 PM, Andy Wilkinson
> >> >
> >> >> Another good trick I've found on the forums is to run:
> >> >> $ gcc -### -e -v -march=native /usr/include/stdlib.h
> >> >>
> >> >> The last line of output will include the various CFLAGS that
> >> >> -march=native
> >> >>
> >> >> picks. In my case (Phenom II 955):
> >> >> "/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1" "-quiet"
> >> >>
> >> >> "/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=2" *"-march=amdfam10"
> >> >> "-mcx16" "-msahf" "-mpopcnt"* "--param" "l1-cache-size=64" "--param"
> >> >> "l1-cache-line-size=64" "--param" "l2-cache-size=512"
> >> >> "-mtune=amdfam10" "-quiet" "-dumpbase" "stdlib.h" "-auxbase"
> >> >> "stdlib" "-o"
> >> >> "/tmp/ccR1PlNZ.s" "--output-pch=/usr/include/stdlib.h.gch"
> >> >>
> >> >> I typically use -march=native when I don't need to worry about
> >> >> distcc, or the options from that output that start with "-m".
> >>
> >> Just shared this trick in my blog.
> >> http://gentoo-what-did-you-say.blogspot.com/2011/07/finding-cpu-flags-us
> >> ing -gcc.html I added a link to this thread in the post.
> >
> > It seems that on my early i7, the -march=core2 does not have all the
> > -msse* flags enabled, while native does:
> >
> > $ diff -y --suppress-common-lines core2.txt native.txt
> > -mcx16 [disabled] | -mcx16 [enabled]
> > -mno-sse4 [enabled] | -mno-sse4 [disabled]
> > -mpopcnt [disabled] | -mpopcnt [enabled]
> > -msahf [disabled] | -msahf [enabled]
> > -msse [disabled] | -msse [enabled]
> > -msse2 [disabled] | -msse2 [enabled]
> > -msse3 [disabled] | -msse3 [enabled]
> > -msse4 [disabled] | -msse4 [enabled]
> > -msse4.1 [disabled] | -msse4.1 [enabled]
> > -msse4.2 [disabled] | -msse4.2 [enabled]
> > -mssse3 [disabled] | -mssse3 [enabled]
> > -mtune= | -mtune= core2
> >
> >
> > I wonder if I should just set it to "-march=native -O2 -pipe" and forget
> > about it ... native it seems to have more stuff switched on and it would
> > probably be a-good-thing® (although my understanding of what each flag
> > does is rather cursory).
> > --
> > Regards,
> > Mick
>
> Just curious if that's consistent with /proc/cpuinfo in the flags
> section? MAybe gcc is wrong in it's enable/disable choices, or maybe
> they know something specific.
>
> This is from an i7-980 Extreme from about 1 year ago:
>
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
> syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts
> rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64
> monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt
> aes lahf_lm ida arat dts tpr_shadow vnmi flexpriority ept vpid
Same here:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm
constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc
aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm
sse4_1 sse4_2 popcnt lahf_lm ida dts tpr_shadow vnmi flexpriority ept vpid
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-27 18:32 ` Mick
2011-07-27 20:24 ` Mark Knecht
@ 2011-07-27 21:11 ` pk
2011-07-28 9:40 ` Kfir Lavi
2 siblings, 0 replies; 22+ messages in thread
From: pk @ 2011-07-27 21:11 UTC (permalink / raw
To: gentoo-user
On 2011-07-27 20:32, Mick wrote:
> It seems that on my early i7, the -march=core2 does not have all the -msse*
> flags enabled, while native does:
Acc. to this there is a flag for i7, BUT... I'm not sure if current
stable version accepts it:
http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
> I wonder if I should just set it to "-march=native -O2 -pipe" and forget about
> it ... native it seems to have more stuff switched on and it would probably be
> a-good-thing® (although my understanding of what each flag does is rather
> cursory).
I assume "native" would do fine...
Best regards
Peter K
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [gentoo-user] CFlags for CPU
2011-07-27 18:32 ` Mick
2011-07-27 20:24 ` Mark Knecht
2011-07-27 21:11 ` pk
@ 2011-07-28 9:40 ` Kfir Lavi
2011-07-28 9:46 ` Helmut Jarausch
2 siblings, 1 reply; 22+ messages in thread
From: Kfir Lavi @ 2011-07-28 9:40 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 2682 bytes --]
On Wed, Jul 27, 2011 at 9:32 PM, Mick <michaelkintzios@gmail.com> wrote:
> On Wednesday 27 Jul 2011 17:13:21 Kfir Lavi wrote:
> > On Wed, Jul 27, 2011 at 5:34 PM, Kfir Lavi <lavi.kfir@gmail.com> wrote:
> > > On Wed, Jul 27, 2011 at 5:09 PM, Andy Wilkinson
> > >>
> > >> Another good trick I've found on the forums is to run:
> > >> $ gcc -### -e -v -march=native /usr/include/stdlib.h
> > >>
> > >> The last line of output will include the various CFLAGS that
> > >> -march=native
> > >>
> > >> picks. In my case (Phenom II 955):
> > >> "/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1" "-quiet"
> > >>
> > >> "/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=2" *"-march=amdfam10"
> > >> "-mcx16" "-msahf" "-mpopcnt"* "--param" "l1-cache-size=64" "--param"
> > >> "l1-cache-line-size=64" "--param" "l2-cache-size=512"
> "-mtune=amdfam10"
> > >> "-quiet" "-dumpbase" "stdlib.h" "-auxbase" "stdlib" "-o"
> > >> "/tmp/ccR1PlNZ.s" "--output-pch=/usr/include/stdlib.h.gch"
> > >>
> > >> I typically use -march=native when I don't need to worry about distcc,
> > >> or the options from that output that start with "-m".
>
> > Just shared this trick in my blog.
> >
> http://gentoo-what-did-you-say.blogspot.com/2011/07/finding-cpu-flags-using
> > -gcc.html I added a link to this thread in the post.
>
> It seems that on my early i7, the -march=core2 does not have all the -msse*
> flags enabled, while native does:
>
> $ diff -y --suppress-common-lines core2.txt native.txt
> -mcx16 [disabled] | -mcx16 [enabled]
> -mno-sse4 [enabled] | -mno-sse4 [disabled]
> -mpopcnt [disabled] | -mpopcnt [enabled]
> -msahf [disabled] | -msahf [enabled]
> -msse [disabled] | -msse [enabled]
> -msse2 [disabled] | -msse2 [enabled]
> -msse3 [disabled] | -msse3 [enabled]
> -msse4 [disabled] | -msse4 [enabled]
> -msse4.1 [disabled] | -msse4.1 [enabled]
> -msse4.2 [disabled] | -msse4.2 [enabled]
> -mssse3 [disabled] | -mssse3 [enabled]
> -mtune= | -mtune= core2
>
>
> I wonder if I should just set it to "-march=native -O2 -pipe" and forget
> about
> it ... native it seems to have more stuff switched on and it would probably
> be
> a-good-thing® (although my understanding of what each flag does is rather
> cursory).
> --
> Regards,
> Mick
>
My guess is that -msse4.2 imply also -msse1..4.1
Can someone confirm this?
Regards,
Kfir
[-- Attachment #2: Type: text/html, Size: 3944 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [gentoo-user] CFlags for CPU
@ 2011-07-27 14:52 Pandu Poluan
0 siblings, 0 replies; 22+ messages in thread
From: Pandu Poluan @ 2011-07-27 14:52 UTC (permalink / raw
To: gentoo-user
-original message-
Subject: Re: [gentoo-user] CFlags for CPU
From: Andy Wilkinson <drukargin@gmail.com>
Date: 2011-07-27 21:09
>Another good trick I've found on the forums is to run:
>
>$ gcc -### -e -v -march=native /usr/include/stdlib.h
>
>The last line of output will include the various CFLAGS that
>-march=native picks. In my case (Phenom II 955):
>
> "/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1" "-quiet"
>"/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=2" *"-march=amdfam10"
>"-mcx16" "-msahf" "-mpopcnt"* "--param" "l1-cache-size=64" "--param"
>"l1-cache-line-size=64" "--param" "l2-cache-size=512" "-mtune=amdfam10"
>"-quiet" "-dumpbase" "stdlib.h" "-auxbase" "stdlib" "-o"
>"/tmp/ccR1PlNZ.s" "--output-pch=/usr/include/stdlib.h.gch"
>
>I typically use -march=native when I don't need to worry about distcc,
>or the options from that output that start with "-m".
Hey, that's a nice trick! Thanks for re-sharing :)
That said, I usually *can't* use -march=native because all my Gentoo systems are virtualized servers, running on top of XenServer, which itself runs on heterogenous server boxes (all Intel).
So, I purposefully limit myself to "-march=nocona".
(I did raise an explicit point about -march parameter in my Gentoo-Wiki article)
Rgds,
--
FdS Pandu E Poluan
~ IT Optimizer ~
Sent from Nokia E72-1
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2011-07-28 10:02 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-26 20:36 [gentoo-user] CFlags for CPU Alokat
2011-07-26 18:58 ` Michael Mol
2011-07-27 0:58 ` Bill Kenworthy
2011-07-27 3:08 ` [gentoo-user] " Nikos Chantziaras
2011-07-26 18:59 ` [gentoo-user] " Alan McKinnon
2011-07-26 18:59 ` Mark Knecht
2011-07-26 19:02 ` Paul Hartman
2011-07-26 22:01 ` Mick
2011-07-26 22:15 ` Paul Hartman
2011-07-26 19:22 ` pk
2011-07-27 14:09 ` Andy Wilkinson
2011-07-27 14:34 ` Kfir Lavi
2011-07-27 16:13 ` Kfir Lavi
2011-07-27 18:32 ` Mick
2011-07-27 20:24 ` Mark Knecht
2011-07-27 20:56 ` Mick
2011-07-27 21:11 ` pk
2011-07-28 9:40 ` Kfir Lavi
2011-07-28 9:46 ` Helmut Jarausch
2011-07-28 9:51 ` Kfir Lavi
2011-07-28 10:01 ` Helmut Jarausch
-- strict thread matches above, loose matches on Subject: below --
2011-07-27 14:52 Pandu Poluan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox