Commit 40a0b479 authored by Arthur Tritthart's avatar Arthur Tritthart
Browse files

tuned function matrix_product_mant_exp_fx (regular case) in WMOPS (about...

tuned function matrix_product_mant_exp_fx (regular case) in WMOPS (about -36.2), all bit-exact to previous version
parent e499d56a
Loading
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
@@ -1040,6 +1040,7 @@ Word16 matrix_product_mant_exp_fx(
    }
    ELSE /* Regular case */
    {
#ifndef FIX_TUNE_IVAS_TOOLS_MATRIX_PRODUCT_WMOPS_MR1010X
        IF( NE_16( colsX, rowsY ) )
        {
            return EXIT_FAILURE;
@@ -1068,6 +1069,43 @@ Word16 matrix_product_mant_exp_fx(
        move16();
        col = rowsX; /*Q0*/
        move16();
#else
        assert( colsX == rowsY );
        assert ( colsX >= 1 );

        Word16 XY_fx_e = add( X_fx_e, Y_fx_e );

        FOR( j = 0; j < colsY; ++j )
        {
            Word16 j_rowsY = imult1616( j, rowsY );
            FOR( i = 0; i < rowsX; ++i )
            {
                Word32 Z_fx_m;
                Word16 Z_fx_e;

                x_idx = add( i, 0 );
                y_idx = add( 0, j_rowsY );
                Z_fx_m = Mpy_32_32( X_fx[x_idx], Y_fx[y_idx]);
                Z_fx_e = XY_fx_e;
                FOR( k = 1; k < colsX; ++k )
                {
                    x_idx = add( x_idx, rowsX );
                    y_idx = add( 1, y_idx );
                    Z_fx_m = BASOP_Util_Add_Mant32Exp( Z_fx_m, Z_fx_e, Mpy_32_32( X_fx[x_idx], Y_fx[y_idx] ), XY_fx_e, &Z_fx_e ); /*Q31 - Zp_fx_e*/
                }
                *Zp_fx++ = Z_fx_m;
                move32();
                *Zp_fx_e++ = Z_fx_e;
                move16();
            }
        }


        row = colsY; /*Q0*/
        move16();
        col = rowsX; /*Q0*/
        move16();
#endif
    }
    Zp_fx = Z_fx; /*Q31 - Zp_fx_e*/
    Zp_fx_e = out_e;
+2 −0
Original line number Diff line number Diff line
@@ -153,3 +153,5 @@
#define FIX_881_HILBERT_FILTER                  /* VA: improve the precision of the Hilbert filter to remove 2kHz unwanted tone */
#endif
#define FIX_MINOR_SVD_WMOPS_MR1010X             /* FhG: Minor WMOPS tuning, bit-exact to previous version, saves about 8.2 WMOPS for MR1010 */
#define FIX_TUNE_IVAS_TOOLS_MATRIX_PRODUCT_WMOPS_MR1010X /* FhG: Major WMOPS tuning in HQ matrix multiplication, bit-exact to previous version, saves about 37 WMOPS for MR1010 */