Commit 7263a7ee authored by Fabian Bauer's avatar Fabian Bauer Committed by Sandesh Venkatesh
Browse files

add SPEEDUP 17, 18, inactive

parent 2248f4d1
Loading
Loading
Loading
Loading
+59 −14
Original line number Diff line number Diff line
@@ -59,9 +59,10 @@
//#define FIX_1326_SPEEDUP_11 // tiny speedup                     //  .1 WMOPS   pipe 48851 fails   --> DONTUSEYET
//#define FIX_1326_SPEEDUP_13 // replace div/sqrt->isqrt          // 2.9 WMOPS                      --> USE

#define FIX_1326_SPEEDUP_15 // replace Ladd(Mpy) -> Madd          // .1 WMOPS                   --> USE? (pipe tbd)
#define FIX_1326_SPEEDUP_16 // tiny speedup like 04              // .18 WMOPS                     --> USE? (pipe tbd)

//#define FIX_1326_SPEEDUP_15 // replace Ladd(Mpy) -> Madd        //  .1 WMOPS                      --> USE
//#define FIX_1326_SPEEDUP_16 // tiny speedup like 04             //  .2 WMOPS                      --> USE
//#define FIX_1326_SPEEDUP_17 // use 1/x                            //  1  WMOPS                      --> USE?
//#define FIX_1326_SPEEDUP_18 // structural speedup                   // 1 WMOPS                      --> USE?

Word16 slot_fx[4] = { 32767, 16384, 10922, 8192 };

@@ -3343,6 +3344,7 @@ static void eig2x2_fx(

    /* Numeric case, when input is practically zeros */
    // IF( D_fx[0] < EPSILON_FX )

#ifdef FIX_1326_SPEEDUP_02
    IF( LT_32( L_shl_sat( D_fx[0], sub( sub( 31, *q_D ), EPSILON_EXP ) ), EPSILON_MANT ) )
    {
@@ -3370,7 +3372,7 @@ static void eig2x2_fx(
#endif

    /* Numeric case, when input is near an identity matrix with a gain */
#ifdef FIX_1326_SPEEDUP_03               // 178.932
#ifdef FIX_1326_SPEEDUP_03 
    tmp1 = Mpy_32_32( 2147484, add_fx ); // 2147484 = 1e-3f in Q31

    IF( LT_32( pm_fx, L_shl_sat( tmp1, sub( q_tmp1, q_tmp2 ) ) ) )
@@ -3469,7 +3471,11 @@ static void eig2x2_fx(
#endif

#if 1
#ifdef FIX_1326_SPEEDUP_17
            tmp2 = BASOP_Util_Divide3232_Scale_cadence_1( ONE_IN_Q30, tmp3, &exp );
#else
            tmp2 = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, tmp3, &exp );
#endif
            exp = sub( exp, sub( Q30, sub( 31, exp_tmp3 ) ) );
            normVal_fx = Sqrt32( tmp2, &exp ); // q_tmp2
            q_tmp2 = sub( 31, exp );
@@ -3557,7 +3563,11 @@ static void eig2x2_fx(
#endif

#if 1
#ifdef FIX_1326_SPEEDUP_17
            tmp2 = BASOP_Util_Divide3232_Scale_cadence_1( ONE_IN_Q30, tmp3, &exp );
#else
            tmp2 = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, tmp3, &exp );
#endif
            exp = sub( exp, sub( Q30, sub( 31, exp_tmp3 ) ) );
            normVal_fx = Sqrt32( tmp2, &exp ); // q_tmp2
            q_tmp2 = sub( 31, exp );
@@ -3619,7 +3629,19 @@ static void eig2x2_fx(
            move16();
        }
    }
#ifdef FIX_1326_SPEEDUP_18
    if( q_U_1 != 0 )
    {
        *q_U = q_U_1;
        move16();
    }

    if (q_U_1 == 0)
    {
        *q_U = q_U_2;
        move16();
    }
#else
    IF( q_U_1 != 0 )
    {
        *q_U = q_U_1;
@@ -3629,6 +3651,7 @@ static void eig2x2_fx(
        *q_U = q_U_2;
    }
    move16();
#endif

    return;
}
@@ -4508,7 +4531,11 @@ static void formulate2x2MixingMatrix_fx(
    ELSE
    {
        push_wmops( "formulate2x2MixingMatrix Division" );
#ifdef FIX_1326_SPEEDUP_17
        maxEneDiv_fx = BASOP_Util_Divide3232_Scale_cadence_1( ONE_IN_Q30, maxEne_fx, &exp );
#else
        maxEneDiv_fx = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, maxEne_fx, &exp );
#endif
        pop_wmops(); /*push_wmops( "formulate2x2MixingMatrix Division" )*/
        q_maxEneDiv = add( sub( 31, exp ), sub( Q30, q_maxEne ) );
    }
@@ -4630,6 +4657,11 @@ static void formulate2x2MixingMatrix_fx(
    }
    ELSE
    {
        if ( E_out2 == 0 )
        {
            static int a = 0;
            a++;
        }
        temp = BASOP_Util_Add_Mant32Exp( temp, sub( 31, q_ein ), EPSILON_MANT, EPSILON_EXP, &exp_temp );
        push_wmops( "formulate2x2MixingMatrix Division" );
        temp = BASOP_Util_Divide3232_Scale_cadence( E_out2, temp, &exp1 );
@@ -4777,7 +4809,12 @@ static void formulate2x2MixingMatrix_fx(
    ELSE
    {
        push_wmops( "formulate2x2MixingMatrix Division" );
#ifdef FIX_1326_SPEEDUP_17
        temp = BASOP_Util_Divide3232_Scale_cadence_1( ONE_IN_Q30, D_fx[0], &exp );
#else
      
        temp = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, D_fx[0], &exp );
#endif
        exp = sub( exp, sub( Q30, q_D ) );
        pop_wmops(); /*push_wmops( "formulate2x2MixingMatrix Division" )*/
    }
@@ -4811,7 +4848,11 @@ static void formulate2x2MixingMatrix_fx(
    ELSE
    {
        push_wmops( "formulate2x2MixingMatrix Division" );
#ifdef FIX_1326_SPEEDUP_17
        temp = BASOP_Util_Divide3232_Scale_cadence_1( ONE_IN_Q30, D_fx[1], &exp1 );
#else
        temp = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, D_fx[1], &exp1 );
#endif
        pop_wmops(); /*push_wmops( "formulate2x2MixingMatrix Division" )*/
        exp1 = sub( exp1, sub( Q30, q_D ) );
    }
@@ -5021,7 +5062,11 @@ static void formulate2x2MixingMatrix_fx(
            Word16 Pre_shift, Pim_shift;
            temp = BASOP_Util_Add_Mant32Exp( Sx_fx[chB], sub( 31, q_Sx ), EPSILON_MANT, EPSILON_EXP, &exp_temp );
            push_wmops( "formulate2x2MixingMatrix Division" );
#ifdef FIX_1326_SPEEDUP_17
            temp = BASOP_Util_Divide3232_Scale_cadence_1( ONE_IN_Q30, temp, &exp );
#else
            temp = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, temp, &exp );
#endif
            pop_wmops(); /*push_wmops( "formulate2x2MixingMatrix Division" )*/
            q_temp = add( sub( sub( q_P, exp ), sub( 31, Q30 ) ), exp_temp );