GCC相当于VC的浮点模型开关?
GCC 是否有与 VC 的浮点模型开关等效的编译器开关(<代码>/fp)?
特别是,我的应用程序受益于使用 /fp:fast
编译,并且精度并不是什么大问题,我应该如何使用 GCC 编译它?
Does GCC have an equivalent compiler switch to VC's floating point model switch (/fp
)?
In particular, my application benefits from compiling with /fp:fast
and precision is not a big deal, how should I compile it with GCC?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
-ffast-math
。在 gcc 4.4.1 上,此选项打开:-fno-math-errno
- 不要为单指令数学函数设置 errno。-funsafe-math-optimizations
- 假设数学运算的参数和结果有效,并且可能违反标准-ffinite-math-only
- 假设参数和结果是有限的。-fno-rounding-math
- 启用采用默认舍入的优化。这是默认设置,但它可以被其他内容覆盖。-fno-signaling-nans
- 启用可以更改数学异常数量的优化。也是默认的-fcx-limited-range
- 假设复数除法不需要范围缩小:__FAST_MATH__
宏。您也可以单独启用这些。
Try
-ffast-math
. On gcc 4.4.1, this turns on:-fno-math-errno
- Don't set errno for single instruction math functions.-funsafe-math-optimizations
- Assume arguments and result of math operations are valid, and potentially violate standards-ffinite-math-only
- Assume arguments and results are finite.-fno-rounding-math
- Enable optimizations that assume default rounding. This is the default, but it could be overridden by something else.-fno-signaling-nans
- Enable optimizations that can change number of math exceptions.; also default-fcx-limited-range
- Assume range reduction is not needed for complex number division:__FAST_MATH__
macro.You could also enable these individually.