| View previous topic :: View next topic |
| Author |
Message |
samsungNC10user n00b

Joined: 20 Mar 2009 Posts: 73
|
Posted: Mon Oct 08, 2012 7:00 pm Post subject: CPU flags |
|
|
hi
wich of those flags schould i include in make.conf?
| Quote: | processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz
stepping : 7
microcode : 0x25
cpu MHz : 2494.762
cache size : 3072 KB
physical id : 0
siblings : 4
core id : 1
cpu cores : 2
apicid : 3
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 13
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 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 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4988.59
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
|
sse3 is not listed can i still assume my cpu supports sse3? |
|
| Back to top |
|
 |
krinn Advocate


Joined: 02 May 2003 Posts: 3677
|
Posted: Mon Oct 08, 2012 8:02 pm Post subject: |
|
|
sse3 is pni (prescott new instructions)
use cflags="-march=native -O2 -pipe" and you'll be fine
If you use distcc or crossbuilding and wish your real cflags, search the forum, there's plenty threads that will gave you way to see what are really your cflags in use. |
|
| Back to top |
|
 |
John R. Graham Administrator


Joined: 08 Mar 2005 Posts: 6441 Location: Somewhere over Atlanta, Georgia
|
Posted: Mon Oct 08, 2012 8:27 pm Post subject: |
|
|
In addition, the Safe CFLAGS page on the Gentoo Linux Wiki is an excellent resource.
- John _________________ This space intentionally left blank. |
|
| Back to top |
|
 |
krinn Advocate


Joined: 02 May 2003 Posts: 3677
|
Posted: Mon Oct 08, 2012 9:02 pm Post subject: |
|
|
Well this is old source, never update, and worst, from all this time, bad value !
Sample: and just the one that always shock me, i'm sure plenty exist :
http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Xeon_w.2Fo_EM64T
| Code: | 32-bit profile (x86):
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64-bit profile (amd64):
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CXXFLAGS="${CFLAGS}"
|
I wonder how then anyone could run a corei7 in 32bits ? -march=i686 ?
Or is it corei7 that is 32bits only ? So the 64bits for corei7 is -march=nocona ?
Even it doesn't harm, there are still plenty guys running 64bits gentoo with a core2 and -march=nocona because of that lame doc  |
|
| Back to top |
|
 |
miroR Apprentice

Joined: 05 Mar 2008 Posts: 228
|
Posted: Wed Nov 07, 2012 11:56 pm Post subject: |
|
|
| krinn wrote: | Well this is old source, never update, and worst, from all this time, bad value !
Sample: and just the one that always shock me, i'm sure plenty exist :
http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Xeon_w.2Fo_EM64T
| Code: | 32-bit profile (x86):
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64-bit profile (amd64):
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CXXFLAGS="${CFLAGS}"
|
I wonder how then anyone could run a corei7 in 32bits ? -march=i686 ?
Or is it corei7 that is 32bits only ? So the 64bits for corei7 is -march=nocona ?
Even it doesn't harm, there are still plenty guys running 64bits gentoo with a core2 and -march=nocona because of that lame doc  |
I don't get all of these, but this is the first time I see you getting a little angry, Krinn!
Never mind. Is it still so bad, or has the page been corrected, in your opinion? (I'm only trying to figure out what to use, since I got my sytems updated to yesterdays best hardware:
http://forums.gentoo.org/viewtopic-p-7179804.html
the CFLAGS issue at the end of the topic at around the same time as this post of mine.) |
|
| Back to top |
|
 |
John R. Graham Administrator


Joined: 08 Mar 2005 Posts: 6441 Location: Somewhere over Atlanta, Georgia
|
Posted: Thu Nov 08, 2012 1:20 am Post subject: |
|
|
| krinn wrote: | | I wonder how then anyone could run a corei7 in 32bits ? -march=i686 ? | That was the CHOST you were seeing, not the -march, and it's correct for 32-bit mode. However, back to the point. Personally, I think the more unused precision on the left of my integers, the better! I can't wait for the 128-bit CPUs!
- John _________________ This space intentionally left blank. |
|
| Back to top |
|
 |
krinn Advocate


Joined: 02 May 2003 Posts: 3677
|
Posted: Sat Nov 10, 2012 5:12 pm Post subject: |
|
|
It's not correct, even it work
I was pointing out that it's dumb to pickup a different -march setting because of the x86/x86-64 arch
For the first cpu type i pickup the example for, i don't know it, but if nocona is valid, i will assume it is, and the output should have been that :
| Code: | 32-bit profile (x86):
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64-bit profile (amd64):
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CXXFLAGS="${CFLAGS}"
|
And for a core i7 example
| Code: | 32-bit profile (x86):
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=corei7 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64-bit profile (amd64):
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=corei7 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
|
Because this wiki gave bad information throwing at user the -march settings is influence by the ARCH type.
So from all those days, that wiki let users think they could use any -march that is valid for their cpu in 64bits.
And if they want run it in 32bits they must use a non-64bits -march settings. Hence the stupidity i spoke off (32bits corei7 using -march=i686)
the -march depend on gcc version, your taste about code to get, and your cputype.
And here's a valid corei7 -march settings in 32bits, despite what the wiki suggest : http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Core_i7_and_Core_i5.2C_Xeon_55xx
Look at their stupid 32bit profile (x86) suggest, as i just check it 1 minute ago
| Quote: | Portage 2.1.11.9 (default/linux/x86/10.0/desktop, gcc-4.7.1, glibc-2.15-r2, 3.4.7 i686)
=================================================================
System uname: Linux-3.4.7-i686-Intel-R-_Core-TM-_i7_CPU_950_@_3.07GHz-with-gentoo-2.1
Portage 2.1.11.9 (default/linux/x86/10.0/desktop, gcc-4.7.1, glibc-2.15-r2, 3.4.7 i686)
...
CFLAGS="-march=corei7 -mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=corei7 -mfpmath=sse -O2 -pipe"
|
|
|
| Back to top |
|
 |
John R. Graham Administrator


Joined: 08 Mar 2005 Posts: 6441 Location: Somewhere over Atlanta, Georgia
|
Posted: Sat Nov 10, 2012 6:00 pm Post subject: |
|
|
Hmm. I see your point. You've put your finger on at least one of the issues, though: "correct" changes over time. "-march=corei7" didn't exist until recently as a valid compiler option and you were forced into a compromise.
- John _________________ This space intentionally left blank. |
|
| Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 29985 Location: 56N 3W
|
Posted: Sat Nov 10, 2012 6:31 pm Post subject: |
|
|
samsungNC10user,
Unless you are using distcc, set | Code: | | -O2 -march=native -pipe | for your CFLAGS.
If you don't know what distcc is, you are not using it.
Some software has specially hand crafted assembler sections to take advantage of the Single Instruction Multiple Data (SIMD) instructions found on various CPUs.
It usually only multimedia software. To invoke these speedups, set the correct USE flags to match your CPU. Choosing wrong flags here may get you an Illegal Instruction error as the CPU tries to execute an instruction it doesn't have.
The USE flags have similar (but not always identical) names to the flags in cpuflags.
Install ufed and compare your list of cpuflags against the USE flags. Set any which match. I'll leave it to you to work out the list.
On a related note, you have the x2apic flag. This is a very good thing provided you also set the kernel option to use it. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
| Back to top |
|
 |
djdunn l33t


Joined: 26 Dec 2004 Posts: 617 Location: Under the moon and all the stars in the sky.
|
Posted: Sun Nov 11, 2012 1:03 am Post subject: |
|
|
march native even adds some things that the correct -march does not, at least for amdfam10 with gcc 4.5.3 for me native adds some memory tweaks for my cache on the cpu that march amdfam10 does not _________________ Now, with penguins, (cuddly such), "contented" means it has either just gotten laid, or it's stuffed on herring. Take it from me, I'm an expert on penguins, those are really the only two options.
--Linus Torvalds |
|
| Back to top |
|
 |
yngwin Developer


Joined: 19 Dec 2002 Posts: 4389 Location: Suzhou, China
|
|
| Back to top |
|
 |
|