Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CPU flags
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
samsungNC10user
n00b
n00b


Joined: 20 Mar 2009
Posts: 73

PostPosted: Mon Oct 08, 2012 7:00 pm    Post subject: CPU flags Reply with quote

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
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 4296

PostPosted: Mon Oct 08, 2012 8:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 7840
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Oct 08, 2012 8:27 pm    Post subject: Reply with quote

In addition, the Safe CFLAGS page on the Gentoo Linux Wiki is an excellent resource.

- John
_________________
This space intentionally left blank.
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 4296

PostPosted: Mon Oct 08, 2012 9:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
miroR
Guru
Guru


Joined: 05 Mar 2008
Posts: 383

PostPosted: Wed Nov 07, 2012 11:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 7840
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Nov 08, 2012 1:20 am    Post subject: Reply with quote

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! :P

- John
_________________
This space intentionally left blank.
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 4296

PostPosted: Sat Nov 10, 2012 5:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 7840
Location: Somewhere over Atlanta, Georgia

PostPosted: Sat Nov 10, 2012 6:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 32104
Location: 56N 3W

PostPosted: Sat Nov 10, 2012 6:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
djdunn
l33t
l33t


Joined: 26 Dec 2004
Posts: 702
Location: Arrakis

PostPosted: Sun Nov 11, 2012 1:03 am    Post subject: Reply with quote

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
_________________
A process cannot be understood by stopping it. Understanding must move with the flow of the process, must join it and flow with it.

-The First Law of Mentat
Back to top
View user's profile Send private message
yngwin
Developer
Developer


Joined: 19 Dec 2002
Posts: 4394
Location: Suzhou, China

PostPosted: Mon Nov 12, 2012 4:15 am    Post subject: Reply with quote

John R. Graham wrote:
In addition, the Safe CFLAGS page on the Gentoo Linux Wiki is an excellent resource.

Please don't confuse the old community wiki with the newer official Gentoo Wiki.
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum