diff options
| author | Ajax <commial@gmail.com> | 2015-11-10 18:15:31 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2015-11-10 18:15:31 +0100 |
| commit | 2dc0ca9b7c689b3ca9e4dcd3919b985c6f44128f (patch) | |
| tree | 4fdf43d23bb413c375e8bc2b228e3b1a54a5c4be | |
| parent | c093394ac0b7b4384cf8ee5514d47cc420aee447 (diff) | |
| download | miasm-2dc0ca9b7c689b3ca9e4dcd3919b985c6f44128f.tar.gz miasm-2dc0ca9b7c689b3ca9e4dcd3919b985c6f44128f.zip | |
x86/TCC: complete fxam semantic to handle C1
| -rw-r--r-- | miasm2/arch/x86/sem.py | 1 | ||||
| -rw-r--r-- | miasm2/jitter/vm_mngr.c | 7 | ||||
| -rw-r--r-- | miasm2/jitter/vm_mngr.h | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index 49833b1c..1c10f5e5 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -1800,6 +1800,7 @@ def fxam(ir, instr): e = [] e.append(m2_expr.ExprAff(float_c0, m2_expr.ExprOp('fxam_c0', a))) + e.append(m2_expr.ExprAff(float_c1, m2_expr.ExprOp('fxam_c1', a))) e.append(m2_expr.ExprAff(float_c2, m2_expr.ExprOp('fxam_c2', a))) e.append(m2_expr.ExprAff(float_c3, m2_expr.ExprOp('fxam_c3', a))) diff --git a/miasm2/jitter/vm_mngr.c b/miasm2/jitter/vm_mngr.c index 6b248bcb..82da0c33 100644 --- a/miasm2/jitter/vm_mngr.c +++ b/miasm2/jitter/vm_mngr.c @@ -1358,6 +1358,13 @@ unsigned int fxam_c0(double a) } } +unsigned int fxam_c1(double a) +{ + if ((a < 0) || isnan(a)) + return 1; + return 0; +} + unsigned int fxam_c2(double a) { switch(fpclassify(a)) { diff --git a/miasm2/jitter/vm_mngr.h b/miasm2/jitter/vm_mngr.h index 2a934d5a..f04d1057 100644 --- a/miasm2/jitter/vm_mngr.h +++ b/miasm2/jitter/vm_mngr.h @@ -380,6 +380,7 @@ unsigned int fcom_c1(double a, double b); unsigned int fcom_c2(double a, double b); unsigned int fcom_c3(double a, double b); unsigned int fxam_c0(double a); +unsigned int fxam_c1(double a); unsigned int fxam_c2(double a); unsigned int fxam_c3(double a); |