about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--miasm2/arch/mips32/sem.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/miasm2/arch/mips32/sem.py b/miasm2/arch/mips32/sem.py
index d96e6b2d..3d895cda 100644
--- a/miasm2/arch/mips32/sem.py
+++ b/miasm2/arch/mips32/sem.py
@@ -118,17 +118,14 @@ def mul(ir, instr, a, b, c):
     e.append(ExprAff(a, ExprOp('imul', b, c)))
     return None, e, []
 
-def sltu(ir, instr, a, b, c):
+def sltu(ir, instr, a, x, y):
     e = []
-    e.append(ExprAff(a, (b-c).msb().zeroExtend(32)))
+    e.append(ExprAff(a, (((x - y) ^ ((x ^ y) & ((x - y) ^ x))) ^ x ^ y).msb().zeroExtend(32)))
     return None, e, []
 
-def slt(ir, instr, a, b, c):
+def slt(ir, instr, a, x, y):
     e = []
-    #nf - of
-    # TODO CHECK
-    f = (b-c).msb() ^ (((a ^ c) & (~(a ^ b)))).msb()
-    e.append(ExprAff(a, f.zeroExtend(32)))
+    e.append(ExprAff(a, ((x - y) ^ ((x ^ y) & ((x - y) ^ x))).zeroExtend(32)))
     return None, e, []
 
 def l_sub(ir, instr, a, b, c):