Commit 340c1458 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

maximum_exp_fx: if mantissa is zero, ignore exponents in comparison

parent c3635a68
Loading
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -2169,9 +2169,21 @@ Word16 maximum_exp_fx(

    FOR( j = 1; j < lvec_fx; j++ )
    {
        Word16 tmp = sub( exp_vec[j], exp_vec[ind] );
        if ( vec_fx[j] == 0 )
        {
            tmp = 0;
            move16();
        }
        if ( vec_fx[ind] == 0 )
        {
            tmp = 0;
            move16();
        }

        /* if(vec[j] > vec[ind])                                                                                                    //means   */
        /* if( GT_32(    L_shr_sat( L_deposit_l( vec_fx[j])), sub( exp_vec[ind], exp_vec[j] )  , L_deposit_l( vec_fx[ind] )))   //is like */
        if ( L_mac0_sat( L_shl_sat( L_deposit_l( vec_fx[j] ), sub( exp_vec[j], exp_vec[ind] ) ), vec_fx[ind], -0x0001 ) > 0 )
        if ( L_mac0_sat( L_shl_sat( L_deposit_l( vec_fx[j] ), tmp, s), vec_fx[ind], -0x0001 ) > 0 )
        {
            ind = j;
            move16();