QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: xjflyttp

求助如何让GCC编译器根据CPU类型优化代码

[复制链接]
 楼主| 发表于 2006-6-12 20:00:14 | 显示全部楼层
[quote:0f347bb5bc="KDE"]优化选项及注意事项参见 magic linux 开发培训区的置顶帖:
RPM 建包 (GCC) 优化选项

真是不可理解,为什么以讹传讹如此严重,看下面最后一行:
-fomit-frame-pointer
Don't keep the frame pointer in a register for functions that don't need one. This avoids the instructions to save, set up and restore frame pointers; it also makes an extra register available in many functions. It also makes debugging impossible on some machines.
On some machines, such as the VAX, this flag has no effect, because the standard calling sequence automatically handles the frame pointer and nothing is saved by pretending it doesn't exist. The machine-description macro "FRAME_POINTER_REQUIRED" controls whether a target machine supports this flag.
Enabled at levels -O, -O2, -O3, -Os.

-fomit-frame-pointer 明明已经默认包含于 -O, -O2, -O3, -Os 各个优化级,为什么网上那么多人还要脱裤子放屁,在 -O3 后面还加上 -fomit-frame-pointer?[/quote]

版主大哥~~我也是看网上文章这么写的............搞不清楚~~~~~
回复

使用道具 举报

 楼主| 发表于 2006-6-12 20:02:19 | 显示全部楼层
[quote:35f495287a="fox_eagle2003"]看程序本身的
特别和编写的人的水平有关系

你查这个,还不如超频,让CPU快点--来得实在呢[/quote]


我也没事干搞搞看而已~~~~~~~谢谢拉~~~
回复

使用道具 举报

 楼主| 发表于 2006-6-12 20:05:49 | 显示全部楼层
似乎 gcc的优化并不是通杀的~~~看来还是默认的就好了~~~~~~~~~     
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-11-12 00:16 , Processed in 0.079619 second(s), 13 queries .

© 2021 Powered by Discuz! X3.5.

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