Fix comparison of two negative numbers

Pairs of negative numbers that are equal do not set
the LT flag correctly at runtime.
This commit is contained in:
Stephen Williams 2007-07-03 16:12:55 -07:00
parent 3d0a2aba2c
commit cd8eb8776e
1 changed files with 3 additions and 3 deletions

View File

@ -675,9 +675,9 @@ bool of_CMPS(vthread_t thr, vvp_code_t cp)
sig1 = thr_get_bit(thr, end1); sig1 = thr_get_bit(thr, end1);
sig2 = thr_get_bit(thr, end2); sig2 = thr_get_bit(thr, end2);
/* 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 == 1) && (sig2 == 1) && (eq != 0)) if ((sig1 == 1) && (sig2 == 1) && (eq != 1))
lt ^= 1; lt ^= 1;
/* If the first is negative and the last positive, then /* If the first is negative and the last positive, then