diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2018-06-21 10:59:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-21 10:59:17 +0200 |
| commit | bd80c0876aeecdc027c0c0b0725f0f890d41fa62 (patch) | |
| tree | 5bdb87bbbccfb9ac888c7e9745bd0f3032c963bb | |
| parent | 240902b3b64cfb4ceb9ff80861ec99b1e899c1a1 (diff) | |
| parent | 03fe2f9dffe93b927b6561fd76b3a7e23abc6eb9 (diff) | |
| download | miasm-bd80c0876aeecdc027c0c0b0725f0f890d41fa62.tar.gz miasm-bd80c0876aeecdc027c0c0b0725f0f890d41fa62.zip | |
Merge pull request #777 from GAJaloyan/master
Adding ccmp aarch64 instruction.
| -rw-r--r-- | miasm2/arch/aarch64/sem.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/miasm2/arch/aarch64/sem.py b/miasm2/arch/aarch64/sem.py index ad582878..c232e8dc 100644 --- a/miasm2/arch/aarch64/sem.py +++ b/miasm2/arch/aarch64/sem.py @@ -350,7 +350,36 @@ def csel(arg1, arg2, arg3, arg4): cond_expr = cond2expr[arg4.name] arg1 = arg2 if cond_expr else arg3 +def ccmp(ir, instr, arg1, arg2, arg3, arg4): + e = [] + if(arg2.is_int): + arg2=m2_expr.ExprInt(arg2.arg.arg,arg1.size) + default_nf = arg3[0:1] + default_zf = arg3[1:2] + default_cf = arg3[2:3] + default_of = arg3[3:4] + cond_expr = cond2expr[arg4.name] + res = arg1 - arg2 + new_nf = nf + new_zf = update_flag_zf(res)[0].src + new_cf = update_flag_sub_cf(arg1, arg2, res).src + new_of = update_flag_sub_of(arg1, arg2, res).src + + e.append(m2_expr.ExprAff(nf, m2_expr.ExprCond(cond_expr, + new_nf, + default_nf))) + e.append(m2_expr.ExprAff(zf, m2_expr.ExprCond(cond_expr, + new_zf, + default_zf))) + e.append(m2_expr.ExprAff(cf, m2_expr.ExprCond(cond_expr, + new_cf, + default_cf))) + e.append(m2_expr.ExprAff(of, m2_expr.ExprCond(cond_expr, + new_of, + default_of))) + return e, [] + def csinc(ir, instr, arg1, arg2, arg3, arg4): e = [] cond_expr = cond2expr[arg4.name] @@ -761,6 +790,7 @@ mnemo_func.update({ 'cmp': cmp, 'cmn': cmn, 'movk': movk, + 'ccmp': ccmp, 'csinc': csinc, 'csinv': csinv, 'csneg': csneg, |