Commit ec6f32c7 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

first approach

parent 872360e1
Loading
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
@@ -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  */
@@ -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  */
@@ -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 };