diff options
| author | Ajax <commial@gmail.com> | 2015-11-10 18:43:36 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2015-11-10 18:43:36 +0100 |
| commit | b62587a2b5c1a24892ac825f3c0edbfb765a2572 (patch) | |
| tree | e3aaefd245e8a3906d110f9c5a655ff8ad2209c4 | |
| parent | c7658c8dd151b475177875d49c82b8590ae3779d (diff) | |
| download | miasm-b62587a2b5c1a24892ac825f3c0edbfb765a2572.tar.gz miasm-b62587a2b5c1a24892ac825f3c0edbfb765a2572.zip | |
x86/TCC: add helper for double to 16 bits
Diffstat (limited to '')
| -rw-r--r-- | miasm2/jitter/vm_mngr.c | 12 | ||||
| -rw-r--r-- | miasm2/jitter/vm_mngr.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/miasm2/jitter/vm_mngr.c b/miasm2/jitter/vm_mngr.c index 82da0c33..3e5c262d 100644 --- a/miasm2/jitter/vm_mngr.c +++ b/miasm2/jitter/vm_mngr.c @@ -1083,6 +1083,18 @@ double int_64_to_double(uint64_t m) return d; } +int16_t double_to_int_16(double d) +{ + int16_t i; + + i = (int16_t)d; +#ifdef DEBUG_MIASM_DOUBLE + dump_float(); + printf("%e int %d\n", d, i); +#endif + return i; +} + int32_t double_to_int_32(double d) { int32_t i; diff --git a/miasm2/jitter/vm_mngr.h b/miasm2/jitter/vm_mngr.h index f04d1057..8653dd55 100644 --- a/miasm2/jitter/vm_mngr.h +++ b/miasm2/jitter/vm_mngr.h @@ -390,6 +390,7 @@ double mem_64_to_double(uint64_t m); double int_16_to_double(unsigned int m); double int_32_to_double(unsigned int m); double int_64_to_double(uint64_t m); +int16_t double_to_int_16(double d); int32_t double_to_int_32(double d); int64_t double_to_int_64(double d); double fadd(double a, double b); |