
Inline Assembly Language and Intrinsics
Intrinsic Functions
177Targeting MC56F83xx/DSP5685x Controllers
Example
long l1 = 0x41111111;
short s2 = 1;
long result;
result = L_shr_r(l1,s2);
// Expected value of result: 0x20888889
L_shrtNs
Arithmetic shift of 32-bit value by a specified shift amount.If the shift count is
positive, a right shift is performed. Otherwise, a left shift is performed. Saturation does
not occur during a left shift.
NOTE
Ignores upper N-5 bits of s_shftamount except the sign bit (MSB).
Prototype
Word32 L_shrtNs(Word32 lval2shft, Word16 s_shftamount)
Example
long result, l = 0x24680000;
short s2= 1;
result = L_shrtNs(l,s2);
// Expected value of result: 0x12340000
Modulo Addressing Intrinsic Functions
A modulo buffer is a buffer in which the data pointer loops back to the beginning of
the buffer once the pointer address value exceeds a specified limit.
Figure 7.1
depicts a modulo buffer with the limit six. Increasing the pointer address
value to 0x106 makes it point to the same data it would point to if its address value
were 0x100.
Comentarios a estos manuales