Fix signed ocmpare of negative numbers.
signed compare in proceedural code was comparing the absolute value if both operands were negative. Wrong! Signed-off-by: Stephen Williams <steve@icarus.com>
This commit is contained in:
parent
5d750b7779
commit
acdbe274f9
|
|
@ -867,12 +867,6 @@ bool of_CMPS(vthread_t thr, vvp_code_t cp)
|
|||
|
||||
/* Correct the lt bit to account for the sign of the parameters. */
|
||||
if (lt != BIT4_X) {
|
||||
|
||||
/* If both numbers are negative (and not equal) then
|
||||
switch the direction of the lt. */
|
||||
if ((sig1 == BIT4_1) && (sig2 == BIT4_1) && (eq != BIT4_1))
|
||||
lt = ~lt;
|
||||
|
||||
/* If the first is negative and the last positive, then
|
||||
a < b for certain. */
|
||||
if ((sig1 == BIT4_1) && (sig2 == BIT4_0))
|
||||
|
|
|
|||
Loading…
Reference in New Issue