Commit 53f35590 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '1049-incorrect-complexity-counting-in-shl_ro-function' into 'main'

Resolve "Incorrect complexity counting in shl_ro() function"

Closes #1049

See merge request !812
parents f6c6ffab df984609
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -2825,6 +2825,11 @@ Word16 shr_ro( Word16 var1, Word16 var2, Flag *Overflow )
    {
        var_out = shr_o( var1, var2, Overflow );

#ifdef FIX_1049_SHR_RO_COMPLEXITY
#ifdef WMOPS
        multiCounter[currCounter].shr--;
#endif
#endif
        if ( var2 > 0 )
        {
            if ( ( var1 & ( (Word16) 1 << ( var2 - 1 ) ) ) != 0 )
@@ -2833,6 +2838,15 @@ Word16 shr_ro( Word16 var1, Word16 var2, Flag *Overflow )
            }
        }
    }

#ifdef FIX_1049_SHR_RO_COMPLEXITY
#ifdef WMOPS
    multiCounter[currCounter].shr_r++;
#endif

    BASOP_CHECK();
#endif

    return ( var_out );
}
Word16 shr_r_sat( Word16 var1, Word16 var2 )
+1 −0
Original line number Diff line number Diff line
@@ -85,4 +85,5 @@
#define FIX_ISSUE_1062_AND_1068_TON_ENE_EST_FX
#define FIX_1054_IF_ELSE_CMPLX                          /* VA: Fix 1054 incorrect counting of complexity when ELSE-IF sequence is encoutered in two functions */
#define FIX_1052_COPY_CMPLX_DISCREPANCY       /* VA: modify IF-ELSE statements used in Copy*() functions to avoid dependency on x[] and y[] in RAM */
#define FIX_1049_SHR_RO_COMPLEXITY              /* VA: fix for issue 1049: incorrect counting of complexity in the shr_ro() function */
#endif