User`s guide

Inline Assembly Language and Intrinsics
Intrinsic Functions
145Targeting MC56F83xx/DSP5685x Controllers
Absolute/Negate
The intrinsic functions of the absolute-value/negate group are:
abs_s
negate
L_abs
L_negate
abs_s
Absolute value of a 16-bit integer or fractional value returning a 16-bit result. Returns
0x7FFF for an input of 0x8000.
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 abs_s(Word16 svar1)
Example
int result, s1 = 0xE000; /* - 0.25 */
result = abs_s(s1);
// Expected value of result: 0x2000 = 0.25
negate
Negates a 16-bit integer or fractional value returning a 16-bit result. Returns 0x7FFF
for an input of 0x8000.
Assumptions
OMR’s SA bit was set to 1 at least 3 cycles before this code, that is, saturation on data
ALU results enabled.