diff options
Diffstat (limited to 'miasm2/expression/simplifications_cond.py')
| -rw-r--r-- | miasm2/expression/simplifications_cond.py | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/miasm2/expression/simplifications_cond.py b/miasm2/expression/simplifications_cond.py index 6bdc810f..f6b1ea8b 100644 --- a/miasm2/expression/simplifications_cond.py +++ b/miasm2/expression/simplifications_cond.py @@ -176,57 +176,3 @@ def expr_simp_equal(expr_simp, e): return e return ExprOp_equal(r[jok1], expr_simp(-r[jok2])) - -# Compute conditions - -def exec_inf_unsigned(expr_simp, e): - "Compute x <u y" - if e.op != m2_expr.TOK_INF_UNSIGNED: - return e - - arg1, arg2 = e.args - - if isinstance(arg1, m2_expr.ExprInt) and isinstance(arg2, m2_expr.ExprInt): - return m2_expr.ExprInt(1, 1) if (arg1.arg < arg2.arg) else m2_expr.ExprInt(0, 1) - else: - return e - - -def __comp_signed(arg1, arg2): - """Return ExprInt(1, 1) if arg1 <s arg2 else ExprInt(0, 1) - @arg1, @arg2: ExprInt""" - - val1 = int(arg1) - if val1 >> (arg1.size - 1) == 1: - val1 = - ((int(arg1.mask) ^ val1) + 1) - - val2 = int(arg2) - if val2 >> (arg2.size - 1) == 1: - val2 = - ((int(arg2.mask) ^ val2) + 1) - - return m2_expr.ExprInt(1, 1) if (val1 < val2) else m2_expr.ExprInt(0, 1) - -def exec_inf_signed(expr_simp, e): - "Compute x <s y" - - if e.op != m2_expr.TOK_INF_SIGNED: - return e - - arg1, arg2 = e.args - - if isinstance(arg1, m2_expr.ExprInt) and isinstance(arg2, m2_expr.ExprInt): - return __comp_signed(arg1, arg2) - else: - return e - -def exec_equal(expr_simp, e): - "Compute x == y" - - if e.op != m2_expr.TOK_EQUAL: - return e - - arg1, arg2 = e.args - if isinstance(arg1, m2_expr.ExprInt) and isinstance(arg2, m2_expr.ExprInt): - return m2_expr.ExprInt(1, 1) if (arg1.arg == arg2.arg) else m2_expr.ExprInt(0, 1) - else: - return e |