LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1370|回复: 2

AMD Developer 对AMD平台CPU的GCC优化选项

[复制链接]
发表于 2008-1-15 21:29:53 | 显示全部楼层 |阅读模式
偶然搜到的,大家可以参考看看。不一定要按照上面说的做,只是参考而已!谢谢!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2008-1-16 20:10:41 | 显示全部楼层
试了下,挺风险的,导致编译不能通过的几率加大。

Aggressive GCC optimization:
  –O3              –mtune=k8 –funroll–all–loops –ffast–math
  –ftree-vectorize –combine   –fwhole–program

Flag               What it does
–combine           Allows multiple source files to be optimized simultaneously
                   Speeds up mathematical operations. Warning: results may
–ffast–math        be inexact; does not follow IEEE or ISO math specifications
–fopenmp           OpenMP 2.0 / libgomp support (GCC 4.2.0 and later)
–ftree–vectorize   Autovectorization (optimized in GCC 4.3 and later)
                   Maximizes processors’ branch prediction features in looped
–funroll–all–loops code
–fwhole–program    Makes all global functions and variables static
                   Activates MMX, SSE, SSE2, 3DNow!TM, enhanced 3DNow!TM,
–mtune=k8         and 64-bit instruction set extensions for AMD64 and
                   AMD64-compatible processors
–O3                Aggressive optimization (see man page for full details)
                   Enable SSE3 instructions (Next Generation AMD Opteron
–msse3             and later)
–fprofile–generate These switches may be used with profiling
–fprofile–use      Tools such as AMD CodeAnalystTM to guide optimization
回复 支持 反对

使用道具 举报

发表于 2008-1-16 20:35:28 | 显示全部楼层
–ffast–math 容易出问题
–fopenmp 单CPU用不上
–fwhole–program 会导致动态链接库失败
–funroll–all–loops 优化效果不太好
–fprofile–generate –fprofile–use 是为 profiling 程序分析工具提供的。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表