Fix signed comparison in op_jl
This commit is contained in:
parent
f8f5ac7ad0
commit
fa31f39a65
1 changed files with 8 additions and 11 deletions
|
|
@ -251,17 +251,14 @@ class ZCpu:
|
|||
# Fallthrough: No args were equal to a.
|
||||
self._branch(False)
|
||||
|
||||
def op_jl(self, a, *others):
|
||||
"""Branch if the first argument is less than any subsequent
|
||||
argument. Note that the second operand may be absent, in
|
||||
which case there is no jump."""
|
||||
for b in others:
|
||||
if a < b:
|
||||
self._branch(True)
|
||||
return
|
||||
|
||||
# Fallthrough: No args were greater than a.
|
||||
self._branch(False)
|
||||
def op_jl(self, a, b):
|
||||
"""Branch if the first argument is less than the second."""
|
||||
a = self._make_signed(a)
|
||||
b = self._make_signed(b)
|
||||
if a < b:
|
||||
self._branch(True)
|
||||
else:
|
||||
self._branch(False)
|
||||
|
||||
def op_jg(self, a, b):
|
||||
"""Branch if the first argument is greater than the second."""
|
||||
|
|
|
|||
Loading…
Reference in a new issue