Commit f2a5aeb5 authored by ber's avatar ber
Browse files

buildfix

parent 6f8bd46b
Loading
Loading
Loading
Loading
Loading
+1 −20
Original line number Diff line number Diff line
@@ -411,55 +411,36 @@ static Word16 ISqrt16_common( Word16 m,
}

/* local function for ISqrt32 and ISqrt32norm */
//#define ISqrt32_common_INCREASEPRECISION
static Word32 ISqrt32_common( Word32 m,
                              Word16 e )
{
    Word16 index;
#ifndef ISqrt32_common_INCREASEPRECISION
    Word16 m16, frac;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
#endif
#endif

    assert( m >= 0x40000000 );
#ifndef ISqrt32_common_INCREASEPRECISION
#ifdef BASOP_NOGLOB
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    m16 = round_fx_o( m, &Overflow );
#else
    m16 = round_fx( m );
#endif
#endif

    /* get table index (upper 6 bits minus 32) */
    /* index = (m16 >> 25) - 32; */
#ifndef ISqrt32_common_INCREASEPRECISION
    index = mac_r( -32768 - ( 32 << 16 ), m16, 1 << 6 );
#else
    index = mac_r( -32768 - ( 32 << 16 ), L_shr( m, 16 ), 1 << 6 );
#endif


#ifdef ISqrt32_common_INCREASEPRECISION /*plusmoreprec*/
    /* interpolate */
    Word32 frac32 = L_and( m, 0x1FFFFFF );
    m = L_sub( ISqrtTable[index], Mpy_32_16_r( frac32, ISqrtDiffTable[index] ) );
#else
    /* get fractional part for interpolation (lower 9 bits) */
    frac = s_and( m16, 0x1FF ); /* Q9 */

    /* interpolate */
    m = L_msu( ISqrtTable[index], ISqrtDiffTable[index], frac );
#endif

    /* handle even exponents */
    if ( s_and( e, 1 ) == 0 )
#ifndef ISqrt32_common_INCREASEPRECISION
        m = Mpy_32_16_1( m, 0x5a82 );
#else
        m = Mpy_32_32_r( m, 0x5A82799A );
#endif


    return m;