Main Content

Compile with GCC -ffast-math

Enables the GCC compiler -ffast-math option when compiling real-time application code

Model Configuration Pane: Code Generation / Simulink Real-Time Options

Description

Enables the GCC compiler -ffast-math option when compiling real-time application code. This option is disabled by default for Simulink® Real-Time™ models.

By enabling the Compile with GCC -ffast-math option, you provide the compiler with more flexibility to optimize floating-point math at the expense of deviating from the IEEE-754 floating-point standard.

For more information about the -ffast-math option, see the Semantics of Floating-Point Math in GCC.

Dependencies

None

Settings

off | on

Default: off

off

When UseGCCFastMath is disabled, Simulink Real-Time compiles real-time application code without the compiler -ffast-math option.

on

When UseGCCFastMath is enabled, Simulink Real-Time compiles real-time application code with the compiler -ffast-math option.

Examples

expand all

  • To get the UseGCCFastMath option value for real-time application object my_app that is loaded on target computer, type in the MATLAB Command Window:

    my_app = slrealtime.Application('slrt_ex_osc')
    app_object.Options.get.UseGCCFastMath

Recommended Settings

ApplicationSetting

Debugging

on

Traceability

on

Efficiency

on

Safety precaution

off

Programmatic Use

Parameter: UseGCCFastMath
Type: character vector
Value: 'off' | 'on'
Default: 'off'

Version History

Introduced in R2020b