User`s guide

Inline Assembly Language and Intrinsics
Intrinsic Functions
168
Targeting MC56F83xx/DSP5685x Controllers
Shifting
The intrinsic functions of the shifting group are:
shl
shlftNs
shlfts
shr
shr_r
shrtNs
L_shl
L_shlftNs
L_shlfts
L_shr
L_shr_r
L_shrtNs
shl
Arithmetic shift of 16-bit value by a specified shift amount. If the shift count is
positive, a left shift is performed. Otherwise, a right shift is performed. Saturation may
occur during a left shift. When an accumulator is the destination, zeroes out the LSP
portion.
NOTE
This operation is not optimal on the DSP56800E because of the
saturation requirements and the bidirectional capability. See the
intrinsic shlftNs or shlfts which are more optimal.
Assumptions
OMR’s SA bit was set to 1 at least 3 cycles before this code, that is, saturation on data
ALU results enabled.
Prototype
Word16 shl(Word16 sval2shft, Word16 s_shftamount)