Main Content
Replace multiplications by powers of two with signed bitwise shifts
Replace multiplications by powers of two with signed bitwise shifts
Model Configuration Pane: Code Generation / Code Style
Description
Specify whether to replace multiplications by powers of two with signed bitwise shifts. Some coding standards, such as MISRA, do not allow bitwise operations on signed integers. Clearing this option increases the likelihood of generating MISRA C™ compliant code.
Settings
on
(default) | off
Default: on
- On
Generate code that replaces multiplications by powers of two with signed bitwise shifts.
- Off
Do not allow replacement of multiplications by powers of two with signed shifts. Clearing this option supports MISRA C compliance.
Examples
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | On |
Safety precaution | No impact |
Programmatic Use
Parameter: EnableSignedLeftShifts |
Type: character vector |
Value: 'on' | 'off' |
Default: 'on' |
Version History
Introduced in R2011b