Download Target Settings

Transcript
Inline Assembly Language and Intrinsic Functions
List of Intrinsic Functions: Definitions and Examples
short s1 = 0x2468;
short s2= 1;
result = __shr(s1,s2);
// Expected value of result: 0x1234
__shr_r
Definition
Note
Assumptions
Prototype
Example
Arithmetic shift of 16-bit value by a specified shift amount. If the
shift count is positive, a right shift is performed. Otherwise, a left
shift is performed. If a right shift is performed, then rounding
performed on result.
Saturation may occur during a left shift.
When an accumulator is the destination, zeroes out the LSP portion.
This operation is not optimal on the DSP56800 because of the
saturation requirements and the bidirectional capability.
OMR’s SA bit was set to 1 at least 3 cycles before this code, that is,
saturation on data ALU results enabled.
Word16 __shr_r(Word16 s_val2shft, Word16
s_shftamount)
short result;
short s1 = 0x2468;
short s2= 1;
result = __shr(s1,s2);
// Expected value of result: 0x1234
_L_shl
Definition
Arithmetic shift of 32-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.
Targeting DSP56800
DSP–175