Replace multiply operations in array indices when accessing arrays in a loop.
Category: Optimization
Default: Off
In array indices, replace multiply operations with add operations when accessing arrays in a loop in the generated code. When the original signal is multidimensional, the Embedded Coder® generates one-dimensional arrays, resulting in multiply operations in the array indices. Using this setting eliminates costly multiply operations when accessing arrays in a loop in the C/C++ program. This optimization (commonly referred to as strength reduction) is particularly useful if the C/C++ compiler on the target platform does not have similar functionality. The absence of multiply operations in the C/C++ program does not imply that the C/C++ compiler does not generate multiply instructions.
Leave multiply operations in array indices when accessing arrays in a loop.
This parameter:
Requires a Embedded Coder license to generate code.
Appears only for ERT-based targets.
Parameter:
StrengthReduction |
Value:
'on' | 'off' |
Default:
'off' |
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | On (execution speed) |
Safety precaution | No impact |