Main Content

Shift right on a signed integer as arithmetic shift

Description

Describe how your compiler for the test hardware fills the sign bit in a right shift of a signed integer.

Category: Hardware Implementation

Settings

Default: On

On

Generates simple, efficient code whenever the Simulink® model performs arithmetic shifts on signed integers.

Off

Generates fully portable but less efficient code to implement right arithmetic shifts.

Tips

  • Select this parameter if your C compiler implements a signed integer right shift as an arithmetic right shift.

  • An arithmetic right shift fills bits vacated by the right shift with the value of the most significant bit, which indicates the sign of the number in twos complement notation. It is equivalent to dividing the number by 2.

  • This setting affects only code generation.

Dependency

  • Selecting a device by using the Device vendor and Device type parameters sets a device-specific value for this parameter.

  • This parameter is enabled only if you can modify it for the selected hardware.

Command-Line Information

Parameter: TargetShiftRightIntArith
Value: 'on' | 'off'
Default: 'on'

Recommended settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOn
Safety precaution

No impact when Test hardware is the same as production hardware is selected. If it is not selected, no recommendation.

Related Topics