diff options
| author | serpilliere <fabrice.desclaux@cea.fr> | 2015-10-18 18:43:35 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-10-23 10:53:51 +0200 |
| commit | ced7b6f5e73e3818bf4bb922e75684375b4be387 (patch) | |
| tree | f4fabe46009fedd48d7635eec92391dbf543461a | |
| parent | 1d8d18fa887fdd7e1eb2c8978bcf69e95fc74f81 (diff) | |
| download | miasm-ced7b6f5e73e3818bf4bb922e75684375b4be387.tar.gz miasm-ced7b6f5e73e3818bf4bb922e75684375b4be387.zip | |
Arch/x86/sem: add fcompp; fix fcomp
| -rw-r--r-- | miasm2/arch/x86/sem.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index 51d4342f..6d678bfb 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -1836,9 +1836,11 @@ def float_pop(avoid_flt=None, popcount=1): # XXX TODO -def fcom(ir, instr, a, b = None): +def fcom(ir, instr, a=None, b=None): - if b is None: + if a is None and b is None: + a, b = float_st0, float_st1 + elif b is None: b = a a = float_st0 @@ -1910,12 +1912,20 @@ def fucomip(ir, instr, a, b): return e, [] -def fcomp(ir, instr, a, b = None): +def fcomp(ir, instr, a=None, b=None): e, extra = fcom(ir, instr, a, b) e += float_pop() e += set_float_cs_eip(instr) return e, extra + +def fcompp(ir, instr, a=None, b=None): + e, extra = fcom(ir, instr, a, b) + e += float_pop(popcount=2) + e += set_float_cs_eip(instr) + return e, extra + + def ficomp(ir, instr, a, b = None): e, extra = ficom(ir, instr, a, b) e += float_pop() @@ -3655,6 +3665,7 @@ mnemo_func = {'mov': mov, 'movsd': movsd_dispatch, 'movsq': lambda ir, instr: movs(ir, instr, 64), 'fcomp': fcomp, + 'fcompp': fcompp, 'ficomp': ficomp, 'nop': nop, 'fnop': nop, # XXX |