@@ -176,6 +176,14 @@ Word32 BASOP_Util_InvLog2( Word32 x )
Word32BASOP_Util_Log10(Word32x,Word16e)
{
test();
IF(e>=0&&LE_16(e,31))
{
IF(EQ_32(x,L_shl_sat(1,sub(31,e))))
{
return0;
}
}
Word32res=BASOP_Util_Log2(x);
res=L_add(Mpy_32_32(res,646456993/* log10(2) in Q31 */),Mpy_32_32(L_shl(e,25),646456993/* log10(2) in Q31 */));// Adjusting for the exponent mismatch: multiplying first so as to avoid saturation