about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2014-06-13 13:41:07 +0200
committerserpilliere <devnull@localhost>2014-06-13 13:41:07 +0200
commit3c7c2fd0b19bf9435dafbfcb60c7a415c9202f44 (patch)
tree6002830356c959d54af9e5de70cbfdabd2ce47b8
parentee716cc73fddc17c43c792644b351e2206c118d2 (diff)
downloadmiasm-3c7c2fd0b19bf9435dafbfcb60c7a415c9202f44.tar.gz
miasm-3c7c2fd0b19bf9435dafbfcb60c7a415c9202f44.zip
Arm sem: remove == operator
-rw-r--r--miasm2/arch/arm/sem.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/miasm2/arch/arm/sem.py b/miasm2/arch/arm/sem.py
index d40c86eb..e23e2da8 100644
--- a/miasm2/arch/arm/sem.py
+++ b/miasm2/arch/arm/sem.py
@@ -802,25 +802,26 @@ cond_dct = {
 
 
 tab_cond = {COND_EQ: zf,
-            COND_NE: ExprOp('==', zf, ExprInt1(0)),
+            COND_NE: ExprCond(zf, ExprInt1(0), ExprInt1(1)),
             COND_CS: cf,
-            COND_CC: ExprOp('==', cf, ExprInt1(0)),
+            COND_CC: ExprCond(cf, ExprInt1(0), ExprInt1(1)),
             COND_MI: nf,
-            COND_PL: ExprOp('==', nf, ExprInt1(0)),
+            COND_PL: ExprCond(nf, ExprInt1(0), ExprInt1(1)),
             COND_VS: of,
-            COND_VC: ExprOp('==', of, ExprInt1(0)),
-            COND_HI: cf & ExprOp('==', zf, ExprInt1(0)),
+            COND_VC: ExprCond(of, ExprInt1(0), ExprInt1(1)),
+            COND_HI: cf & ExprCond(zf, ExprInt1(0), ExprInt1(1)),
             # COND_HI: cf,
             # COND_HI: ExprOp('==',
             #                ExprOp('|', cf, zf),
             #                ExprInt1(0)),
-            COND_LS: ExprOp('==', cf, ExprInt1(0)) | zf,
-            COND_GE: ExprOp('==', nf, of),
+            COND_LS: ExprCond(cf, ExprInt1(0), ExprInt1(1)) | zf,
+            COND_GE: ExprCond(nf - of, ExprInt1(0), ExprInt1(1)),
             COND_LT: nf ^ of,
             # COND_GT: ExprOp('|',
             #                ExprOp('==', zf, ExprInt1(0)) & (nf | of),
             # ExprOp('==', nf, ExprInt1(0)) & ExprOp('==', of, ExprInt1(0))),
-            COND_GT: ExprOp('==', zf, ExprInt1(0)) & ExprOp('==', nf, of),
+            COND_GT: (ExprCond(zf, ExprInt1(0), ExprInt1(1)) &
+                      ExprCond(nf - of, ExprInt1(0), ExprInt1(1))),
             COND_LE: zf | (nf ^ of),
             }