Commit b5d31923 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '1488-basic-operator-review' into 'main'

Resolve "Basic Operator Review"

Closes #1488

See merge request !1416
parents a72a0f63 8ee4fc15
Loading
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1575,7 +1575,7 @@ Word32 L_msuNs_co( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry, Flag *O
{
    Word32 L_var_out;

    L_var_out = L_mult( var1, var2 );
    L_var_out = L_mult_o( var1, var2, Overflow );
    L_var_out = L_sub_co( L_var3, L_var_out, Carry, Overflow );

    return ( L_var_out );
@@ -2038,6 +2038,7 @@ Word32 DEPR_L_sub_c( Word32 L_var1, Word32 L_var2, Flag *Carry )

    return ( L_var_out );
}

Word32 L_sub_co( Word32 L_var1, Word32 L_var2, Flag *Carry, Flag *Overflow )
{
    Word32 L_var_out;
@@ -2056,6 +2057,7 @@ Word32 L_sub_co( Word32 L_var1, Word32 L_var2, Flag *Carry, Flag *Overflow )
            L_var_out = L_var1 - L_var2;
            if ( L_var1 > 0L )
            {
                set_overflow( Overflow );
                unset_carry( Carry );
            }
        }
@@ -2067,18 +2069,22 @@ Word32 L_sub_co( Word32 L_var1, Word32 L_var2, Flag *Carry, Flag *Overflow )

        if ( ( L_test < 0 ) && ( L_var1 > 0 ) && ( L_var2 < 0 ) )
        {
            set_overflow( Overflow );
            carry_int = 0;
        }
        else if ( ( L_test > 0 ) && ( L_var1 < 0 ) && ( L_var2 > 0 ) )
        {
            set_overflow( Overflow );
            carry_int = 1;
        }
        else if ( ( L_test > 0 ) && ( ( L_var1 ^ L_var2 ) > 0 ) )
        {
            unset_overflow( Overflow );
            carry_int = 1;
        }
        if ( L_test == MIN_32 )
        {
            set_overflow( Overflow );
            carry_int ? set_carry( Carry ) : unset_carry( Carry );
        }
        else