Commit 291030c3 authored by ber's avatar ber
Browse files

cleaned FIX1072_SPEEDUP_chol2x2_fx macros - only use what will be applied

parent c008f4d1
Loading
Loading
Loading
Loading
+4 −82
Original line number Diff line number Diff line
@@ -58,18 +58,8 @@

// Push this chol2x2 config: 0L2L - check pipeline 46154
// (to be rechecked with isqrt precision tweak)
//#define FIX1072_SPEEDUP_chol2x2_fx // 6Mhz _0 + _1 + _2
#ifdef FIX1072_SPEEDUP_chol2x2_fx
//#define FIX1072_SPEEDUP_chol2x2_fx_0
#ifndef FIX1072_SPEEDUP_chol2x2_fx_0
#define FIX1072_SPEEDUP_chol2x2_fx_0_light
#endif
//#define FIX1072_SPEEDUP_chol2x2_fx_1
//#define FIX1072_SPEEDUP_chol2x2_fx_2
#ifndef FIX1072_SPEEDUP_chol2x2_fx_2
#define FIX1072_SPEEDUP_chol2x2_fx_2_light
#endif
#endif
#define FIX1072_SPEEDUP_chol2x2_fx // 6Mhz


// SPEEDUP_matrix 012345: ACCEPT REGRESSIONS                  // NULL: 306.459 Mhz --> difference to SPEEDUP_matrix 012345 : 14Mhz
//#define FIX_1072_SPEEDUP_matrixMul_fx                       //SPEEDUP_matrix_0
@@ -4668,35 +4658,7 @@ static void chol2x2_fx(
        }
        ELSE
        {
#if defined( FIX1072_SPEEDUP_chol2x2_fx ) && defined( FIX1072_SPEEDUP_chol2x2_fx_0 )
            {
                /*2,3 Mhz*/
                // outRe[1][0] = BASOP_Util_Divide3232_Scale_cadence( c_re, outRe[0][0], &exp );
                // q_re2 = add( sub( 31, exp ), sub( q_c, q_re1 ) );
                Word32 tmp32;
                Word16 exp_c = sub( 31, q_c );
                Word16 exp = sub( 31, q_re1 );
                tmp32 = ISqrt32( outRe[0][0], &exp );
                move32();
                tmp32 = Mpy_32_32( tmp32, tmp32 );
                exp = imult1616( exp, 2 );
                outRe[1][0] = Mpy_32_32( tmp32, c_re );
                move32();
                exp = add( exp, exp_c );
                q_re2 = sub( 31, exp );

                // outIm[1][0] = BASOP_Util_Divide3232_Scale_cadence( c_im, outRe[0][0], &exp );
                // q_im = add( sub( 31, exp ), sub( q_c, q_re1 ) );
                exp = sub( 31, q_re1 );
                tmp32 = ISqrt32( outRe[0][0], &exp );
                tmp32 = Mpy_32_32( tmp32, tmp32 );
                exp = imult1616( exp, 2 );
                outIm[1][0] = Mpy_32_32( tmp32, c_im );
                move32();
                exp = add( exp, exp_c );
                q_im = sub( 31, exp );
            }
#elif defined( FIX1072_SPEEDUP_chol2x2_fx ) && defined( FIX1072_SPEEDUP_chol2x2_fx_0_light )
#if defined( FIX1072_SPEEDUP_chol2x2_fx )
            {
                Word32 tmp32 = BASOP_Util_Divide3232_Scale_cadence( 0x7fffffff, outRe[0][0], &exp );
                Word16 exp_re = sub( 31, q_re1 );
@@ -4744,24 +4706,8 @@ static void chol2x2_fx(
        }
        ELSE
        {
#if defined( FIX1072_SPEEDUP_chol2x2_fx ) && defined( FIX1072_SPEEDUP_chol2x2_fx_1 )
            {
                /*2Mhz*/
                // temp = BASOP_Util_Divide3232_Scale_cadence( temp, e1, &exp );
                // q_tmp = add( sub( 31, exp ), sub( q_tmp, q_e ) );
                Word16 exp = sub( 31, q_e );
                Word32 tmp32 = ISqrt32( e1, &exp );
                tmp32 = Mpy_32_32( tmp32, tmp32 );
                exp = imult1616( 2, exp );
                temp = Mpy_32_32( temp, tmp32 );
                exp = add( exp, sub( 31, q_tmp ) );
                q_tmp = sub( 31, exp );
            }

#else
            temp = BASOP_Util_Divide3232_Scale_cadence( temp, e1, &exp );
            q_tmp = add( sub( 31, exp ), sub( q_tmp, q_e ) );
#endif /*FIX1072_SPEEDUP_chol2x2_fx*/
        }
        if ( temp == 0 )
        {
@@ -4869,31 +4815,7 @@ static void chol2x2_fx(
        temp = Madd_32_32( Mpy_32_32( c_re, c_re ), c_im, c_im );
        q_tmp = sub( add( q_c, q_c ), 31 );

#if defined( FIX1072_SPEEDUP_chol2x2_fx ) && defined( FIX1072_SPEEDUP_chol2x2_fx_2 )
        // 4611686 = 1e-12 in Q62
        IF( e2 == 0 )
        {
            // temp = BASOP_Util_Divide3232_Scale_cadence( temp, 4611686, &exp );
            // q_tmp = add( sub( 31, exp ), sub( q_tmp, 62 ) );
            Word32 tmp32 = 1953125005; /* 1/4611686 Q62 */
            Word16 exp = 9;
            temp = Mpy_32_32( temp, tmp32 );
            exp = add( exp, sub( 31, q_tmp ) );
            q_tmp = sub( 31, exp );
        }
        ELSE
        {
            // temp = BASOP_Util_Divide3232_Scale_cadence( temp, e2, &exp );
            // q_tmp = add( sub( 31, exp ), sub( q_tmp, q_e ) );
            Word16 exp = sub( 31, q_e );
            Word32 tmp32 = ISqrt32( e2, &exp );
            tmp32 = Mpy_32_32( tmp32, tmp32 );
            exp = imult1616( 2, exp );
            temp = Mpy_32_32( temp, tmp32 );
            exp = add( exp, sub( 31, q_tmp ) );
            q_tmp = sub( 31, exp );
        }
#elif defined( FIX1072_SPEEDUP_chol2x2_fx ) && defined( FIX1072_SPEEDUP_chol2x2_fx_2_light )
#if defined( FIX1072_SPEEDUP_chol2x2_fx )
        // 4611686 = 1e-12 in Q62
        Word32 tmp32;
        // Word16 exp;