Chinaunix

标题: AMD和Intel CPU的cflags参数 [打印本页]

作者: lsstarboy    时间: 2010-01-12 21:01
标题: AMD和Intel CPU的cflags参数
无意中浏览到的,转到这儿供AMD的网友使用:
http://en.gentoo-wiki.com/wiki/Safe_Cflags/AMD

Safe Cflags/AMD
                        [size=92%]Note: Some processors do support SSE3, but -msse3 is missing from CFLAGS. Was it intentional or it is a mistake? Please discuss at the talk page.
Contents [hide]
K6
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=k6 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

K6-2
vendor_id  : AuthenticAMD
cpu family  : 5
model  : 8
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=k6-2 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 5
model           : 8
model name      : AMD-K6(tm) 3D processor
stepping        : 12
cpu MHz         : 451.031
cache size      : 64 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr mce cx8 pge mmx syscall 3dnow k6_mtrr up
bogomips        : 902.84
clflush size    : 32
[size=92%]Note:/proc/cpuinfo may be confusing. The model name may say "AMD-K6(tm) 3DProcessor" but it is not a AMD K6-3. Rely on the vendor_id, CPU family,and model number.
[size=92%]Note:If you get "Illegal Instruction" errors on compiles (especially longones), you may be running into a cooling problem, or worse yet, a Sig11(segmentation fault/bad ram) problem. Bug #24379 has a discussion about it.

Geode LX processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 5
model           : 10
model name      : Geode(TM) Integrated Processor by AMD PCS
stepping        : 2
cpu MHz         : 498.044
cache size      : 128 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu de pse tsc msr cx8 sep pge cmov clflush mmx mmxext 3dnowext 3dnow
bogomips        : 996.08
clflush size    : 32
CHOST="i486-pc-linux-gnu"
CFLAGS="-march=k6-2 -Os -fno-align-jumps -fno-align-functions -fno-align-labels -fno-align-loops -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
GCC 4.3+:
CHOST="i486-pc-linux-gnu"
CFLAGS="-march=geode -Os -fno-align-jumps -fno-align-functions -fno-align-labels -fno-align-loops -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
[size=92%]Note:While i586-pc-linux-gnu CHOST works fine on a Geode LX,i486-pc-linux-gnu should be a more performant choice right now due tothe way Geode LX CPU pipeline and scheduling works. glibc i586assembler optimized routines are measurably slower than the i486 oneson a Geode LX.

Geode GX1
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=pentium-mmx -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

K6-3
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=k6-3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Duron From 600 to 900 MHz. These models have a tbird-alike core model.
product: AMD Duron(tm) Processor version: 6.3.1
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Mobile Duron
vendor_id : AuthenticAMD
cpu family : 6
model : 3
model name : AMD Duron(tm) Processor
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Duron Morgan From 900 to 1300 MHz.
The Morgan Durons are based on the Palomino core, and hence can be treated as Athlon XP's.
vendor_id : AuthenticAMD
cpu family : 6
model : 7
model name : AMD Duron(tm) Processor
stepping : 1
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Athlon
vendor_id : AuthenticAMD
cpu family : 6
model : 8 or 4 or 2 or 1
model name : AMD Athlon(TM)Processor or AMD-K7(TM)Processor
stepping : 4 or 2 or 1

[size=92%]Note: This processor is only available as a Slot A processor; if you have a Socket A/462 Athlon, it's a Thunderbird (see below).
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Athlon Thunderbird
vendor_id : AuthenticAMD
cpu family : 6
model : 4
model name : AMD Athlon(tm) Processor
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Athlon (Palomino) XP/Duron
vendor_id  : AuthenticAMD
cpu family  : 6
model  : 8
model name  : AMD Athlon(tm)
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
Sempron 2400+ (2000MHz) is also identified as cpu family:6 model:8model_name:AMD Sempron(TM) 2400+ (256kB cache). The Duron 1800+ is alsoincluded in this list.
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 8
model name      : AMD Sempron(tm)   2400+
stepping        : 1
cpu MHz         : 1659.979
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mp
                  mmxext 3dnowext 3dnow up ts
bogomips        : 3328.55
clflush size    : 32

Athlon 4
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-4 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Athlon XP/Geode NX
vendor_id  : AuthenticAMD
cpu family  : 6
model  : 6 or 8
stepping  : 2
Some CPUs have also been observed with the following:
model : 10
model name : AMD Athlon(tm) XP 2500+
stepping : 0
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 6
model name      : AMD Athlon(tm) XP 2000+
stepping        : 2
cpu MHz         : 1670.597
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall
                  mmxext 3dnowext 3dnow up ts
bogomips        : 3343.54
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 8
model name      : AMD Geode NX 1750
stepping        : 1
cpu MHz         : 1400.115
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mp
                  mmxext 3dnowext 3dnow up ts fid vid
bogomips        : 2801.55
clflush size    : 32

Athlon MP
vendor_id  : AuthenticAMD
cpu family  : 6
model  : 10
model name  : AMD Sempron(tm)
stepping  : 0
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-mp -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Athlon 64 32 bit:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64 bit:
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
cpu family  :15
model  :4
model name  :AMD Athlon(tm) 64 Processor 3200+
stepping  :8
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 63
model name      : AMD Athlon(tm) 64 Processor 3200+
stepping        : 2
cpu MHz         : 1999.821
cache size      : 512 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2
                  syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm
bogomips        : 4001.79
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

Athlon 64 X2
vendor_id: AuthenticAMD
cpu family: 15
model: 35, 43, 75 or 107
stepping: 1 or 2
model name: AMD Athlon(tm) 64 X2 Dual Core Processor
32 bit:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64 bit:
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 43
model name      : AMD Athlon(tm)64 X2 Dual Core Processor  4200+
stepping        : 1
cpu MHz         : 2200.000
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2
                  ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow rep_good pni lahf_lm cmp_legacy
bogomips        : 4424.71
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp
processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 43
model name      : AMD Athlon(tm)64 X2 Dual Core Processor  4200+
stepping        : 1
cpu MHz         : 2200.000
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2
                  ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow rep_good pni lahf_lm cmp_legacy
bogomips        : 4424.71
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp
If you have a newer Athlon64("Venice" or "SanDiego")/Athlon64-X2("Manchester", "Toledo", or "Windsor") (check forpni in cat /proc/cpuinfo) you can also add -msse3 to your CFLAGS toenable SSE3 support. Any chip using the 90nm process except for the"Winchester" class Athlon64 supports SSE3.
If you're having gcc-4.3+ and "pni" in flags, you may want touse -march=k8-sse3 instead of -march=k8. You can take out the -msse3 bydoing this.
Also bear in mind that all Athlon64 X2 and Opteron 165, 170,175, 180, and 185 processors are dual-core CPUs so make sure that youuse MAKEOPTS="-j3" in your make.conf. This doesn't affect the code butmight reduce compile times.
All socket AM2 processors are SSE3 capable as well.
There are some socket AM2+ Athlon processors which are Phenombased (Athlon X2 7550, Athlon X2 7750, Athlon X2 7850). Look below.

1xx Opteron
vendor_id : AuthenticAMD
cpu family : 15
model : 5
model name : AMD Opteron(tm) Processor 1xx
stepping : 8
32-bit:
CHOST="i686-pc-linux-gnu"
CFLAGS="-O2 -march=opteron -msse3 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64-bit:
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=opteron -O2 -pipe"
CXXFLAGS="${CFLAGS}"
socket 939, single core:
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 39
model name      : AMD Opteron(tm) Processor 144
stepping        : 1
cpu MHz         : 1800.000
cache size      : 1024 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2
                  syscall nx mmxext fxsr_opt lm 3dnowext 3dnow up pni lahf_lm
bogomips        : 3593.50
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp
socket 939, dual core:
processor       : [0 | 1]
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 35
model name      : Dual Core AMD Opteron(tm) Processor 180
stepping        : 2
cpu MHz         : 1000.000
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : [0 | 1]
cpu cores       : 2
apicid          : [0 | 1]
initial apicid  : [0 | 1]
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy
bogomips        : 2006.23
clflush size    : 64
power management: ts fid vid ttp

2xx/8xx Opteron
vendor_id : AuthenticAMD
cpu family : 15
model : 5
model name : AMD Opteron(tm) Processor xxx
stepping : 8
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=opteron -O2 -pipe"
CXXFLAGS="${CFLAGS}"

22xx Dual-Core Opteron
vendor_id : AuthenticAMD
cpu family : 15
model : 65
model name : Dual-Core AMD Opteron(tm) Processor 22xx
stepping : 2
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=opteron -O2 -pipe"
CXXFLAGS="${CFLAGS}"
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 65
model name      : Dual-Core AMD Opteron(tm) Processor 2212 HE
stepping        : 3
cpu MHz         : 2010.298
cache size      : 1024 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu tsc msr pae mce cx8 apic mca cmov pat pse36 clflush mmx fxsr sse sse2
ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy
bogomips        : 4022.18
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc

23xx Quad-Core Barcelona
vendor_id  : AuthenticAMD
cpu family  : 16
model  : 2
model name  : Quad-Core AMD Opteron(tm) Processor 23xx
stepping  : 10
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CXXFLAGS="${CFLAGS}"

[size=92%]Note: For GCC 4.3+ you may use the -march=barcelona option.
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 2
model name      : Quad-Core AMD Opteron(tm) Processor 2354
stepping        : 3
cpu MHz         : 2200.000
cache size      : 512 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2
                  ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good pni monitor
                  cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw
                  ibs
bogomips        : 4402.66
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

Athlon X2 7x50, Phenom X3/X4, Phenom II, Athlon II
vendor_id  : AuthenticAMD
cpu family  : 16
model  : 2
model name  : AMD Phenom(tm) xxxx Triple/Quad-Core Processor
stepping  : 2/3
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
[size=92%]Note: For versions of GCC olderthan 4.3+ you have to use -march=k8 -msse3 -msse4a to get all processorfeatures (as long as your version of gcc supports them).
processor        : 0
vendor_id        : AuthenticAMD
cpu family        : 16
model                : 4
model name        : AMD Phenom(tm) II X3 720 Processor
stepping        : 2
cpu MHz                : 2812.378
cache size        : 512 KB
physical id        : 0
siblings        : 3
core id                : 0
cpu cores        : 3
apicid                : 0
initial apicid        : 0
fdiv_bug        : no
hlt_bug                : no
f00f_bug        : no
coma_bug        : no
fpu                : yes
fpu_exception        : yes
cpuid level        : 5
wp                : yes
flags                : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall
                  nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc nonstop_tsc pni monitor cx16 lahf_lm cmp_legacy
                  svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt
bogomips        : 5624.75
clflush size        : 64
power management: ts ttp tm stc 100mhzsteps hwpstate
processor                : 0
vendor_id                : AuthenticAMD
cpu family                : 16
model                        : 2
model name                : AMD Phenom(tm) 9950 Quad-Core Processor
stepping                : 3
cpu MHz                : 2808.614
cache size                : 512 KB
physical id                : 0
siblings                : 4
core id                : 0
cpu cores                : 4
apicid                        : 0
initial apicid                : 0
fpu                        : yes
fpu_exception                : yes
cpuid level                : 5
wp                        : yes
flags                        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall
                          nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good pni monitor cx16 lahf_lm cmp_legacy
                          svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs
bogomips                : 5617.22
TLB size                : 1024 4K pages
clflush size                : 64
cache_alignment        : 64
address sizes                : 48 bits physical, 48 bits virtual
power management        : ts ttp tm stc 100mhzsteps hwpstate

Sempron / Sempron64 vendor_id : AuthenticAMD
cpu family : 15
model : 44
model name : AMD Sempron(tm) Processor

32 bit (Socket A):
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64 bit (Socket 754):
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
64 bit (Socket 754/AM2, SSE3 capable):
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -msse3 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
64-bit (Socket AM3):
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -pipe"
CXXFLAGS="${CFLAGS}"

Turion64 / X2 / Ultra 32 bit:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -msse3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64 bit:
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -msse3 -O2 -pipe"
CXXFLAGS="${CFLAGS}"

Mobile Sempron vendor_id : AuthenticAMD
cpu family : 15
model : 8
model name : Mobile AMD Sempron Processor 2800+
32 bit:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -msse3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64 bit:
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -msse3 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
If you have a Sempron without SSE3 (earlier chips), omit "-msse3".SSE3 is called pni (prescott new instuction) by cpuinfo (cat/proc/cpuinfo).
Check it out, there are many different sempron mobile CPUs onsale, those that work at 1.8GHz are K8 (i.e. AMD SM 3000+), someothers, older, aren't yet k8 but they're still k7 so you must specifyathlon-xp instead of athlon64, anyway AMD announced in 2006 there willbe 64bit Sempron Mobile CPUs so be carefull and pay attention, run acat /proc/cpuinfo and then ask on AMD forums if you don't know what todo.
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 44
model name      : Mobile AMD Sempron(tm) Processor 3000+
stepping        : 2
cpu MHz         : 1800.000
cache size      : 128 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2
                  syscall nx mmxext fxsr_opt 3dnowext 3dnow pni lahf_lm ts fid vid ttp tm stc
bogomips        : 3602.19
clflush size    : 64

[ 本帖最后由 lsstarboy 于 2010-1-12 21:40 编辑 ]
作者: macafee    时间: 2010-01-12 21:20
有一定价值,不过如果能有个详细程序做个优化前和优化后的对比就更有价值了!
作者: lsstarboy    时间: 2010-01-12 21:21
http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel

Contents


Pentium
vendor_id : GenuineIntel
cpu family : 5
model : 2
model name : Pentium 75 - 200
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=pentium -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Pentium w/ MMX CHOST="i586-pc-linux-gnu"
CFLAGS="-march=pentium-mmx -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Pentium Pro
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentiumpro -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Pentium II
vendor_id : GenuineIntel
cpu family : 6
model : 3, 5
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium2 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 6
model name      : Mobile Pentium II
stepping        : 10
cpu MHz         : 397.082
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr
bogomips        : 794.75
clflush size    : 32

Celeron (Mendocino), aka Celeron1
vendor_id : GenuineIntel
cpu family : 6
model : 6
stepping : 0
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium2 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 6
model name      : Celeron (Mendocino)
stepping        : 0
cpu MHz         : 334.108
cache size      : 128 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr up
bogomips        : 686.94
clflush size    : 32

Pentium III/ Mobile Celeron
vendor_id : GenuineIntel
cpu family : 6
model : 7, 8, 11
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 8
model name      : Pentium III (Coppermine)
stepping        : 6
cpu MHz         : 863.934
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips        : 1728.97
clflush size    : 32

Celeron (Coppermine)
vendor_id  : GenuineIntel
cpu family  : 6
model  : 8
stepping  : 10
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Celeron (Willamette)
vendor_id  : GenuineIntel
cpu family  : 15
model  : 1
model name  : Intel(R) Celeron(R) CPU 1.70GHz
stepping  : 3
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Pentium M(Centrino)/Celeron M
vendor_id  : GenuineIntel
cpu family  : 6
model  : 9 or 13
model name  : Intel(R) Pentium(R) M processor XXXXMHz
For gcc 3.3 or older:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -msse2 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
For gcc 3.4 and later:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium-m -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
The Celeron M is based on the Pentium M but it has half the L2 cache and does not support the SpeedStep technology.
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : Intel(R) Pentium(R) M processor 2.00GHz
stepping        : 8
cpu MHz         : 800.000
cache size      : 2048 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
                  pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx up bts est tm2
bogomips        : 1597.70
clflush size    : 64

Mobile Pentium 4-M (Northwood)
vendor_id  : GenuineIntel
cpu family  : 15
model  : 2
model name  : Mobile Intel(R) Pentium(R) 4 - M CPU X.XXGHz
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Pentium 4
vendor_id  : GenuineIntel
cpu family  : 15
model  : 0 or 1 or 2
model name  : Intel(R) Pentium(R) 4 CPU XXXXMHz
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Pentium 4 (Prescott) / Celeron D
vendor_id : GenuineIntel
cpu family : 15
model : 3 or 4
model name  : Intel(R) Pentium(R) 4 CPU XXXGHz -or- Intel(R) Celeron(R) CPU XXXGHz
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 -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

[size=92%]Note:You can verify the chip is a Prescott by looking for pni in the flagssection of /proc/cpuinfo. This indicates support for SSE3.
In 2004, Intel started branding processors with the Prescott core as Intel Celeron D.

Pentium D 8xx / 9xx
vendor_id : GenuineIntel
cpu family : 15
model  : 4, 6
model name  : Intel(R) Pentium(R) D CPU x.xxGHz
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 -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Xeon w/o EM64T
vendor_id  : GenuineIntel
cpu family  : 15
model  : 2
model name  : Intel(R) Xeon(TM) CPU 2.80GHz
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Xeon w/EM64T (also Pentium 4 P6xx or Celeron M 5xx)
vendor_id  : GenuineIntel
cpu family  : 15
model  : 4,6
model name  : Intel(R) Xeon(R) CPU XXXXMHz
model name  : Intel(R) Celeron(R) M CPU 5xx @ XXXGHz
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 -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Intel Core Solo/Duo, Pentium Dual-Core T20xx/T21xx
vendor_id  : GenuineIntel
cpu family  : 6
model  : 14, 22
model name  : Genuine Intel(R) CPU TXXXX @ XXXGHz
model name  : Intel(R) Celeron(R) CPU 220 @ 1.20GHz
model name  : Intel(R) Celeron(R) CPU 4X0 @ XXXGHz
model name  : Intel(R) Celeron(R) M CPU 4X0  @ XXXGHz

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
Notes:
Core 2 Duo/Quad, Xeon 51xx/53xx/54xx, Pentium Dual-Core T23xx+/Exxxx, Celeron Dual-Core
vendor_id  : GenuineIntel
cpu family  : 6
model  : 15
model name  : Intel(R) Core(TM)2 CPU XXXX @ XXXGHz
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}"
32 bit Gentoo FreeBSD:
CHOST="i686-gentoo-freebsd6.2"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="$CFLAGS"

[size=92%]Note:  If you are using >GCC 4.3.2-r3 or higher, you can use the -march=core2 flag with your Intel Core2 Processor.  (See the change log).If you have a "penryn" model you can use the -msse4.1 flag to pull insse 4.1 optimizations (check for sse4_1 in /proc/cpuinfo)

Core i7
vendor_id       : GenuineIntel
cpu family      : 6
model           : 26
model name      : Intel(R) Core(TM) i7 CPU         920  @ 2.67GHz
32 bit profile (x86) - for <sys-devel/gcc-4.3:
CHOST="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=nocona -msse3 -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
32 bit profile (x86) - for >=sys-devel/gcc-4.3:
CHOST="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core2 -msse4 -mcx16 -msahf -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64 bit profile (amd64) - for <sys-devel/gcc-4.3
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -mssse3 -pipe"
CXXFLAGS="${CFLAGS}"
64 bit profile (amd64) - for >=sys-devel/gcc-4.3
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe"
CXXFLAGS="${CFLAGS}"

[size=92%]Note:  If you are using the -msse4 option, then there is no need to add -msse4.1 or -msse4.2. They are implied by -msse4.
[edit]  Atom An Intel engineer put a guide on stable CFLAGS for the Atom procesor.
In summary, it is stated that these are the "suggested" CFLAGS:
-O1 -msse3 -march=core2 -mfpmath=sse -pipe
-fstrength-reduce -fexpensive-optimizations -finline-functions
-funroll-loops -foptimize-register-move

[size=92%]Note: :if you read the linked article, these flags are tested/suggested for asingle, very specific app, and look like they were generated by Acovea. They are therefore almost certainly bad for general useas the purpose of Acovea is to exhaustively test flags for a single apponly. He lists the generic flags elsewhere in the article, as listedbelow:
-O2 -msse3 -march=core2 -mfpmath=sse

Atom 230
vendor_id       : GenuineIntel
cpu family      : 6
model           : 28
model name      : Intel(R) Atom(TM) CPU  230   @ 1.60GHz
stepping        : 2
cpu MHz         : 1596.175
cache size      : 512 KB
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}"
[edit]  Atom N270/N280 For GCC versions prior to 4.3:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
For GCC versions post and including 4.3:

[size=92%]Note: These CFLAGSset GCC to generate code for Intel Core processor family, but withgeneric instruction tuning suitable for the Atom's in-order executionengine. (Note that -fomit-frame-pointer is optional. If you're using the machine for debugging, you do not want to enable this flag)
CHOST="i686-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -mtune=generic -fomit-frame-pointer -pipe"
CXXFLAGS="${CFLAGS}"

Atom 330 32 bit profile (x86):
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j5"
64 bit profile (amd64):
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j5"
64 bit profile (amd64) & GCC 4.3.2, core2 gives ~15% more performance & yields stable builds.
CFLAGS="-march=core2 -O2 -pipe"

Atom Z520 32 bit profile (x86):
CHOST="i686-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -mtune=generic -fomit-frame-pointer -pipe"
CXXFLAGS="${CFLAGS}"

[ 本帖最后由 lsstarboy 于 2010-1-12 21:27 编辑 ]
作者: axlrose    时间: 2010-01-13 09:23
原来是GENTOO WIKI上的呀
作者: pxbfeiniao    时间: 2010-01-13 23:29
-fomit-frame-pointer这个选项要慎用啊。

我的硬件平台是i386,使用这个选项buildworld时会在某处出错。

可能只适用于linux
作者: zeissoctopus    时间: 2010-01-18 20:42
留意 FreeBSD base 的 gcc 只是 GPL-2 舊版的 gcc 4.2.1
作者: windfaddy    时间: 2010-01-25 11:15
明明只有AMD的!
作者: redsunchina    时间: 2010-04-11 16:42
i686。。
作者: liu1103    时间: 2010-04-12 09:36
AMD 4600
作者: 惠繪洋    时间: 2010-04-14 12:10
太好了.. 一直想找這cflags 相關的資訊. 謝
作者: snnn    时间: 2010-05-14 17:39
out了.
-mtune=native
作者: 撒旦的使者    时间: 2010-05-17 13:50
看不懂
作者: mirnshi    时间: 2010-05-17 17:27
使用这些能提高多少?
作者: ulovko    时间: 2012-07-12 20:47
赞! 感谢分享 很实用 ^_^




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2