@@ -176,8 +176,17 @@ 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
res=L_add(Mpy_32_32(res,646456993/* log10(2) in Q31 */),Mpy_32_32(L_shl(e,24),1292913986/* log10(2) in Q32 */));// Adjusting for the exponent mismatch: multiplying first so as to avoid saturation
/* log10(2) is used in Q32 to support exponent till 127 in Mpy_32_32( L_shl( e, 24 ), 1292913986 )*/