User`s guide
Inline Assembly Language and Intrinsics
Intrinsic Functions
161Targeting MC56F83xx/DSP5685x Controllers
Prototype
Word16 mult_r(Word16 sinp1, Word16 sinp2)
Example
short s1 = 0x2000;/* 0.25 */
short s2 = 0x2000;/* 0.25 */
short result;
result = mult_r(s1,s2);
// Expected value of result: 0.0625 = 0x0800
L_mac
Multiply two 16-bit fractional values and add to 32-bit fractional value, generating a
32-bit result, saturating if necessary.
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
Word32 L_mac(Word32 laccum, Word16 sinp1, Word16 sinp2)
Example
short s1 = 0xC000;/* - 0.5 */
short s2 = 0x4000;/* 0.5 */
long result, Acc = 0x20000000;/* 0.25 */
result = L_mac(Acc,s1,s2);
// Expected value of result: 0