代码效率权衡
通过删除执行次正规数值计算的代码或防止仿真与代码生成结果可能不匹配的保护措施,可以提高生成的代码的效率。
要快速入门,请参阅Design Techniques to Optimize Models for Efficient Code Generation。
主题
- Subnormal Number Execution Speed
Minimize the possibility of execution slowdowns or overruns due to subnormal number calculation latency.
- Remove Code for Out-of-Range Floating Point to Integer Conversions
If the input values in your application are in the range of the output type, remove code for out-of-range floating-point to integer conversions.
- Remove Code That Maps NaN to Integer Zero
If input values of
NaNdo not exist in your application, specify that the code generator remove code that mapsNaNto integer zero. - Disable Nonfinite Checks or Inlining for Math Functions
Use code replacement library (CRL) customization entries to selectively disable nonfinite checks for math functions and inlining of math functions.