Loading lib_com/basop_util.c +43 −0 Original line number Diff line number Diff line Loading @@ -2565,6 +2565,47 @@ Word16 BASOP_Util_Cmp_Mant32Exp /*!< o: flag: result of comparison */ headroom is introduced into acc */ #if 1 Word32 BASOP_Util_Add_Mant32Exp( Word32 Mant1, Word16 exp1, Word32 Mant2, Word16 exp2, Word16 *exp_res ) { Word32 tmp1, tmp2, tmp_res; Word16 scale_tmp, scale_tmp2; if ( Mant1 == 0 ) { exp1 = exp2; move16(); } if ( Mant2 == 0 ) { exp2 = exp1; move16(); } scale_tmp = sub( s_max( exp2, exp1 ), 1 ); tmp1 = L_shl( Mant1, sub( exp1, scale_tmp ) ); tmp2 = L_shl( Mant2, sub( exp2, scale_tmp ) ); tmp_res = L_add( tmp1, tmp2 ); scale_tmp2 = norm_l( tmp_res ); tmp_res = L_shl( tmp_res, scale_tmp2 ); *exp_res = sub( scale_tmp, scale_tmp2 ); move16(); return tmp_res; } #else #ifdef OPT_2146_BASOP_UTIL_ADD_MANT32EXP Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ ( Word32 a_m, /* i : Mantissa of 1st operand a */ Loading Loading @@ -2630,6 +2671,7 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ return ( a_m ); } #else Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ ( Word32 a_m, /* i : Mantissa of 1st operand a */ Word16 a_e, /* i : Exponent of 1st operand a */ Loading Loading @@ -2688,6 +2730,7 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ return ( L_tmp ); } #endif #endif static const Word16 shift_lc[] = { 9, 10 }; Loading Loading
lib_com/basop_util.c +43 −0 Original line number Diff line number Diff line Loading @@ -2565,6 +2565,47 @@ Word16 BASOP_Util_Cmp_Mant32Exp /*!< o: flag: result of comparison */ headroom is introduced into acc */ #if 1 Word32 BASOP_Util_Add_Mant32Exp( Word32 Mant1, Word16 exp1, Word32 Mant2, Word16 exp2, Word16 *exp_res ) { Word32 tmp1, tmp2, tmp_res; Word16 scale_tmp, scale_tmp2; if ( Mant1 == 0 ) { exp1 = exp2; move16(); } if ( Mant2 == 0 ) { exp2 = exp1; move16(); } scale_tmp = sub( s_max( exp2, exp1 ), 1 ); tmp1 = L_shl( Mant1, sub( exp1, scale_tmp ) ); tmp2 = L_shl( Mant2, sub( exp2, scale_tmp ) ); tmp_res = L_add( tmp1, tmp2 ); scale_tmp2 = norm_l( tmp_res ); tmp_res = L_shl( tmp_res, scale_tmp2 ); *exp_res = sub( scale_tmp, scale_tmp2 ); move16(); return tmp_res; } #else #ifdef OPT_2146_BASOP_UTIL_ADD_MANT32EXP Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ ( Word32 a_m, /* i : Mantissa of 1st operand a */ Loading Loading @@ -2630,6 +2671,7 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ return ( a_m ); } #else Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ ( Word32 a_m, /* i : Mantissa of 1st operand a */ Word16 a_e, /* i : Exponent of 1st operand a */ Loading Loading @@ -2688,6 +2730,7 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ return ( L_tmp ); } #endif #endif static const Word16 shift_lc[] = { 9, 10 }; Loading