Fix signed compare with minus values
If the operands were negative, and not equal, the lt flag would be set incorrectly. Signed-off-by: Stephen Williams <steve@icarus.com>
This commit is contained in:
parent
018f1a6e7f
commit
e75e7131ac
|
|
@ -868,9 +868,9 @@ bool of_CMPS(vthread_t thr, vvp_code_t cp)
|
||||||
/* Correct the lt bit to account for the sign of the parameters. */
|
/* Correct the lt bit to account for the sign of the parameters. */
|
||||||
if (lt != BIT4_X) {
|
if (lt != BIT4_X) {
|
||||||
|
|
||||||
/* If both numbers are negative, then switch the
|
/* If both numbers are negative (and not equal) then
|
||||||
direction of the lt. */
|
switch the direction of the lt. */
|
||||||
if ((sig1 == BIT4_1) && (sig2 == BIT4_1) && (eq != BIT4_0))
|
if ((sig1 == BIT4_1) && (sig2 == BIT4_1) && (eq != BIT4_1))
|
||||||
lt = ~lt;
|
lt = ~lt;
|
||||||
|
|
||||||
/* If the first is negative and the last positive, then
|
/* If the first is negative and the last positive, then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue