diff options
| author | Camille Mougey <commial@gmail.com> | 2018-11-09 09:12:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-09 09:12:00 +0100 |
| commit | 583c106a23cb1c95523d4cce637e861ffe4c8028 (patch) | |
| tree | 0e3913d3eda6a6d491a102f9b6ea014ef71c3b68 /miasm2/expression/simplifications_cond.py | |
| parent | 8276ac5629fdcf3ad885c8e4b9d2d7ed6e1e1d77 (diff) | |
| parent | 3877d4db136e124973c59d66b106ebe80ce4f732 (diff) | |
| download | miasm-583c106a23cb1c95523d4cce637e861ffe4c8028.tar.gz miasm-583c106a23cb1c95523d4cce637e861ffe4c8028.zip | |
Merge pull request #864 from serpilliere/fix_hl_op
Fix hl op
Diffstat (limited to '')
| -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 |