diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2017-01-05 15:49:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-05 15:49:54 +0100 |
| commit | 06461f1bd7a8c987b47381dffa3e1462cee8e44f (patch) | |
| tree | 0aeb18299450539af192263cf58b720a170561e9 /miasm2/arch/x86/sem.py | |
| parent | afdeb68de2b634c600c30f61422f9fd59286376c (diff) | |
| parent | 6b670aecbadb14cbe28bad9e987fbd5969d2ec63 (diff) | |
| download | miasm-06461f1bd7a8c987b47381dffa3e1462cee8e44f.tar.gz miasm-06461f1bd7a8c987b47381dffa3e1462cee8e44f.zip | |
Merge pull request #468 from commial/feature/llvm-float
Feature/llvm float
Diffstat (limited to 'miasm2/arch/x86/sem.py')
| -rw-r--r-- | miasm2/arch/x86/sem.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index 152208d4..ea5830e3 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -1732,9 +1732,11 @@ def float_pop(avoid_flt=None, popcount=1): if avoid_flt != float_list[i]: e.append(m2_expr.ExprAff(float_list[i], float_list[i + popcount])) + fill_value = m2_expr.ExprOp("int_64_to_double", + m2_expr.ExprInt(0, float_list[i].size)) for i in xrange(8 - popcount, 8): e.append(m2_expr.ExprAff(float_list[i], - m2_expr.ExprInt(0, float_list[i].size))) + fill_value)) e.append( m2_expr.ExprAff(float_stack_ptr, float_stack_ptr - m2_expr.ExprInt(popcount, 3))) @@ -2906,13 +2908,20 @@ def bittest_get(a, b): b_mask = {16: 4, 32: 5, 64: 6} b_decal = {16: 1, 32: 3, 64: 7} ptr = a.arg + segm = a.is_op_segm() + if segm: + ptr = ptr.args[1] + off_bit = b.zeroExtend( a.size) & m2_expr.ExprInt((1 << b_mask[a.size]) - 1, a.size) off_byte = ((b.zeroExtend(ptr.size) >> m2_expr.ExprInt(3, ptr.size)) & m2_expr.ExprInt(((1 << a.size) - 1) ^ b_decal[a.size], ptr.size)) - d = m2_expr.ExprMem(ptr + off_byte, a.size) + addr = ptr + off_byte + if segm: + addr = m2_expr.ExprOp("segm", a.arg.args[0], addr) + d = m2_expr.ExprMem(addr, a.size) else: off_bit = m2_expr.ExprOp('&', b, m2_expr.ExprInt(a.size - 1, a.size)) d = a |