Commit 8650b568 authored by Nicolas Roussin's avatar Nicolas Roussin Committed by Manuel Jander
Browse files

Address Markus' comments.

parent b97da30b
Loading
Loading
Loading
Loading
+49 −0
Original line number Diff line number Diff line
@@ -988,6 +988,55 @@ Word32 div_w( Word32 L_num, Word32 L_den )
}


<<<<<<< HEAD
=======
    /* assert (x >= (Word32)0); */
    assert( y != (Word32) 0 );

    sign = 0;
    move16();

    IF( x < 0 )
    {
        x = L_negate( x );
        sign = L_xor( sign, 1 );
    }

    IF( y < 0 )
    {
        y = L_negate( y );
        sign = L_xor( sign, 1 );
    }

    IF( x == (Word32) 0 )
    {
        *s = 0;
        return ( (Word32) 0 );
    }

    sx = norm_l( x );
    x = L_shl( x, sx );
    x = L_shr( x, 1 );
    move16();
    *s = sub( 1, sx );

    sy = norm_l( y );
    y = L_shl( y, sy );
    move16();
    *s = add( *s, sy );

    z = div_w( x, y );

    if ( sign != 0 )
    {
        z = L_negate( z );
    }

    return z;
}
#endif

>>>>>>> a9eb284cd (Address Markus' comments.)
/*
Table of 256 precalculated estimates to be used by the "div_w_newton"
function using the Newton/Raphson method.
+9 −0
Original line number Diff line number Diff line
@@ -328,6 +328,15 @@ Word16 BASOP_Util_Divide3232_Scale( Word32 x, /*!< i : Numerator*/
                                    Word32 y,    /*!< i  : Denominator*/
                                    Word16 *s ); /*!< o  : Additional scalefactor difference*/

<<<<<<< HEAD
=======
#ifndef REMOVE_BASOP_Util_Divide3232_Scale_cadence
Word32 BASOP_Util_Divide3232_Scale_cadence( Word32 x,    /*!< i  : Numerator*/
                                            Word32 y,    /*!< i  : Denominator*/
                                            Word16 *s ); /*!< o  : Additional scalefactor difference*/
#endif

>>>>>>> a9eb284cd (Address Markus' comments.)
Word32 div_w_newton( Word32 num,   /*!< i  : Numerator*/
                     Word32 den ); /*!< i  : Denominator*/