L_mult

Multiply two 16-bit fractional values generating a signed 32-bit fractional result. Saturates only for the case of 0x8000 x 0x8000.

Assumptions

OMR's SA bit was set to 1 at least three cycles before this code, that is, saturation on data ALU results enabled.

Prototype

  Word32 L_mult(Word16 sinp1, Word16 sinp2)

  

  
Example
short s1 = 0x2000;/*  0.25 */

short s2 = 0x2000;/*  0.25 */

long result;



result = L_mult(s1,s2);

// Expected value of result: 0.0625 = 0x08000000