不同的CPU下最佳编译参数

2016-02-19 17:43 8 1 收藏

今天图老师小编给大家介绍下不同的CPU下最佳编译参数,平时喜欢不同的CPU下最佳编译参数的朋友赶紧收藏起来吧!记得点赞哦~

【 tulaoshi.com - 编程语言 】


  gcc在不同的体系机构/CPU下编译效果有不同,需要使用不同的编译参数达到最佳效果。
  
  一、1.2版(gcc 2.9.x版)
  
  -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=i486 -O3 -pipe -fomit-frame-pointer"
  
  Pentium, Pentium MMX+, Celeron (Mendocino) (Intel)
  CHOST="i586-pc-Linux-gnu"
  CFLAGS="-march=pentium -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=pentium -O3 -pipe -fomit-frame-pointer"
  
  Pentium Pro/II/III/4, Celeron (Coppermine), Celeron (Willamette?) (Intel)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=i686 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=i686 -O3 -pipe -fomit-frame-pointer"
  
  Eden C3/Ezra (Via)
  CHOST="i586-pc-linux-gnu"
  CFLAGS="-march=i586 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=i586 -O3 -pipe -fomit-frame-pointer"
  
  Quote : I did the original gentoo install using 1.2, with gcc 2.95 using -march=i586. i686 won't work.
  
  K6 or beyond (AMD)
  CHOST="i586-pc-linux-gnu"
  CFLAGS="-march=k6 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=k6 -O3 -pipe -fomit-frame-pointer"
  
  (A Duron will report "Athlon" in its /proc/cpuinfo)
  
  Athlon (AMD)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=k6 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=k6 -O3 -pipe -fomit-frame-pointer"
  
  For the following, i don't know of any flag that enhance performances..., do you ?
  
  PowerPC
  CHOST="powerpc-unknown-linux-gnu"
  CFLAGS="-O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-O3 -pipe -fomit-frame-pointer"
  
  Sparc
  CHOST="sparc-unknown-linux-gnu"
  CFLAGS="-O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-O3 -pipe -fomit-frame-pointer"
  
  Sparc 64
  CHOST="sparc64-unknown-linux-gnu"
  CFLAGS="-O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-O3 -pipe -fomit-frame-pointer"
  
  
  二、1.4版(gcc 3.x版):
  
  
  i386 (Intel), do you really want to install gentoo on that ?
  CHOST="i386-pc-linux-gnu"
  CFLAGS="-march=i386 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=i386 -O3 -pipe -fomit-frame-pointer"
  
  i486 (Intel), do you really want to install gentoo on that ?
  CHOST="i486-pc-linux-gnu"
  CFLAGS="-march=i486 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=i486 -O3 -pipe -fomit-frame-pointer"
  
  Pentium 1 (Intel)
  CHOST="i586-pc-linux-gnu"
  CFLAGS="-march=pentium -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=pentium -O3 -pipe -fomit-frame-pointer"
  
  Pentium MMX (Intel)
  CHOST="i586-pc-linux-gnu"
  CFLAGS="-march=pentium-mmx -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=pentium-mmx -O3 -pipe -fomit-frame-pointer"
  
  Pentium PRO (Intel)
  
   CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=pentiumpro -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=pentiumpro -O3 -pipe -fomit-frame-pointer"
  
  Pentium II (Intel)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=pentium2 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=pentium2 -O3 -pipe -fomit-frame-pointer"
  
  Celeron (Mendocino), aka Celeron1 (Intel)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=pentium2 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=pentium2 -O3 -pipe -fomit-frame-pointer"
  
  Pentium III (Intel)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer"
  
  Celeron (Coppermine) aka Celeron2 (Intel)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer"
  
  Celeron (Willamette?) (Intel)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
  
  Pentium 4 (Intel)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
  
  Eden C3/Ezra (Via)
  CHOST="i586-pc-linux-gnu"
  CFLAGS="-march=i586 -m3dnow -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=i586 -m3dnow -O3 -pipe -fomit-frame-pointer"
  
  quote : the ezra doesn't have any special instrUCtions that you could optimize for, just consider is a K6-3...basically
  a p2 with 3dnow
  
  K6 (AMD)
  CHOST="i586-pc-linux-gnu"
  CFLAGS="-march=k6 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=k6 -O3 -pipe -fomit-frame-pointer"
  
  K6-2 (AMD)
  CHOST="i586-pc-linux-gnu"
  CFLAGS="-march=k6-2 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=k6-2 -O3 -pipe -fomit-frame-pointer"
  
  K6-3 (AMD)
  CHOST="i586-pc-linux-gnu"
  CFLAGS="-march=k6-3 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=k6-3 -O3 -pipe -fomit-frame-pointer"
  
  Athlon (AMD)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=athlon -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=athlon -O3 -pipe -fomit-frame-pointer"
  
  Athlon-tbird, aka K7 (AMD)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=athlon-tbird -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=athlon-tbird -O3 -pipe -fomit-frame-pointer"
  
  Athlon-tbird XP (AMD)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
  
   CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
  
  Athlon 4(AMD)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=athlon-4 -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=athlon-4 -O3 -pipe -fomit-frame-pointer"
  
  Athlon XP (AMD)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
  
  Athlon MP (AMD)
  CHOST="i686-pc-linux-gnu"
  CFLAGS="-march=athlon-mp -O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-march=athlon-mp -O3 -pipe -fomit-frame-pointer"
  
  603 (PowerPC)
  CHOST="powerpc-unknown-linux-gnu"
  CFLAGS="-O3 -pipe -fomit-frame-pointer -fsigned-char"
  CXXFLAGS="-O3 -pipe -fomit-frame-pointer -fsigned-char"
  
  603e (PowerPC)
  CHOST="powerpc-unknown-linux-gnu"
  CFLAGS="-O3 -pipe -fomit-frame-pointer -fsigned-char"
  CXXFLAGS="-O3 -pipe -fomit-frame-pointer -fsigned-char"
  
  604 (PowerPC)
  CHOST="powerpc-unknown-linux-gnu"
  CFLAGS="-O3 -pipe -fomit-frame-pointer -fsigned-char"
  CXXFLAGS="-O3 -pipe -fomit-frame-pointer -fsigned-char"
  
  604e (PowerPC)
  CHOST="powerpc-unknown-linux-gnu"
  CFLAGS="-O3 -pipe -fomit-frame-pointer -fsigned-char"
  CXXFLAGS="-O3 -pipe -fomit-frame-pointer -fsigned-char"
  
  750 aka as G3 (PowerPC)
  CHOST="powerpc-unknown-linux-gnu"
  CFLAGS="-mcpu=750 -O3 -pipe -fomit-frame-pointer
  -fsigned-char"
  CXXFLAGS="-mcpu=750 -O3 -pipe -fomit-frame-pointer
  -fsigned-char"
  
  Note: do not use -march=
  
  7400, aka G4 (PowerPC)
  CHOST="powerpc-unknown-linux-gnu"
  CFLAGS="-mcpu=7400 -O3 -pipe -fomit-frame-pointer
  -fsigned-char -maltivec"
  CXXFLAGS="-mcpu=7400 -O3 -pipe -fomit-frame-pointer
  -fsigned-char -maltivec"
  
  Note: do not use -march=
  
  7450, aka G4 second generation (PowerPC)
  CHOST="powerpc-unknown-linux-gnu"
  CFLAGS="-mcpu=7450 -O3 -pipe -fomit-frame-pointer
  -fsigned-char -maltivec"
  CXXFLAGS="-mcpu=7450 -O3 -pipe -fomit-frame-pointer
  -fsigned-char -maltivec"
  
  Note: do not use -march=
  
  PowerPC (If you don't know which one)
  CHOST="powerpc-unknown-linux-gnu"
  CFLAGS="-O3 -pipe -fomit-frame-pointer -fsigned-char"
  CXXFLAGS="-O3 -pipe -fomit-frame-pointer -fsigned-char"
  
  Sparc
  CHOST="sparc-unknown-linux-gnu"
  CFLAGS="-O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-O3 -pipe -fomit-frame-pointer"
  
  Sparc 64
  CHOST="sparc64-unknown-linux-gnu"
  CFLAGS="-O3 -pipe -fomit-frame-pointer"
  CXXFLAGS="-O3 -pipe -fomit-frame-pointer"

来源:http://www.tulaoshi.com/n/20160219/1615918.html

延伸阅读
标签: 电脑入门
通过前面的介绍,我们了解到Linux中cgroups可用来限制cpu资源,那么具体要如何实现呢?下面图老师小编就给大家介绍下Linux中如何使用cgroups来限制cpu资源。 这回说说怎样通过 cgroups 来管理 cpu 资源。先说控制进程的 cpu 使用。在一个机器上运行多个可能消耗大量资源的程序时,我们不希望出现某个程序占据了所有的资源,导致其他程序无...
不同天气下的拍摄攻略!   在阳光充足之下拍摄才会有好照片吗?其实不然。来自Digital Photography School的教学,加上笔者的个人意见,讲述了在不同天气之下的拍摄好处、坏处,还有相应注意的事项,不妨参考一下。 阴天 优:光线柔和 厚厚的云层成为一个天然的柔光板,不会造成景物强烈的阴影。不过由于光线不足,...
标签: 分娩
宝宝几岁可以学才艺呢?其实,这是可以细分的哦。因为,不同的特长,最佳学习年龄是不同的。家长们是不是很好奇呢?下面小编就来介绍 学龄前 儿童学才艺的具体时间。 宝宝特长的最佳学习年龄 学小提琴的适龄期:小提琴演奏是单手拿琴站立演奏,自己要想演奏出好音乐,对手及指头尚小、力量不够的3-4岁幼儿来说,过于勉强。因...
出现此错我的原因是由于ant在执行的时候,默认给JVM的内存不够,需要通过设定启动参数,增加允许使用的内存量。如果是通过命令行直接执行ANT,那么,直接修改启动命令即可。但是,在Eclipse上执行,命令行的设定就不好用了。 自己也是试验了好几次,最后终于搞定。 争取的设定方法是,直接在Eclipse的执行JVM上设定参数,如下: 1.打开Window...
今天在centos6.2下面源码编译安装mysql的时,在编译mysql的时候报了一个蛋蛋的错误: 代码如下: [root@vps870 mysql-5.5.28]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_UNIX_ADDR=/tmp/mysql.sock \ -DDEFAULT_CHARSET=gbk \ -DDEFAULT_COLLATION=gbk_chinese_ci \ -DWITH_EXTRA_CHARSETS:STRING=gbk,gb2312,utf8 ...

经验教程

241

收藏

14
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部