使用 GCC -ffast-math 进行编译
在编译实时应用程序代码时启用 GCC 编译器的 -ffast-math 选项
模型配置窗格: Code Generation / Simulink Real-Time Options
描述
在编译实时应用程序代码时启用 GCC 编译器的 -ffast-math 选项。此选项在 Simulink® Real-Time™ 型号中默认处于禁用状态。
通过启用 Compile with GCC -ffast-math 选项,您将赋予编译器更大的灵活性来优化浮点运算,但代价是偏离 IEEE-754 浮点标准。
有关 -ffast-math 选项的更多信息,请参阅Semantics of Floating-Point Math in GCC。
依赖关系
无
设置
off | on
默认值: off
- off
当
UseGCCFastMath被禁用时,Simulink Real-Time 会在不使用编译器-ffast-math选项的情况下编译实时应用程序代码。- on
当启用
UseGCCFastMath时,Simulink Real-Time 会使用编译器-ffast-math选项编译实时应用程序代码。
推荐设置
| 应用程序 | 设置 |
|---|---|
调试 | on |
可追溯性 | on |
效率 | on |
安全注意事项 | off |
编程用法
参数: UseGCCFastMath
|
| 类型:字符向量 |
值: 'off' | 'on' |
默认值:'off'
|
版本历史记录
在 R2020b 中推出