diff options
Diffstat (limited to 'miasm2/arch/mips32')
| -rw-r--r-- | miasm2/arch/mips32/jit.py | 10 | ||||
| -rw-r--r-- | miasm2/arch/mips32/regs.py | 4 | ||||
| -rw-r--r-- | miasm2/arch/mips32/sem.py | 22 |
3 files changed, 18 insertions, 18 deletions
diff --git a/miasm2/arch/mips32/jit.py b/miasm2/arch/mips32/jit.py index f3e54a7d..1d2ec483 100644 --- a/miasm2/arch/mips32/jit.py +++ b/miasm2/arch/mips32/jit.py @@ -35,8 +35,8 @@ class mipsCGen(CGen): def __init__(self, ir_arch): super(mipsCGen, self).__init__(ir_arch) - self.delay_slot_dst = m2_expr.ExprId("branch_dst_irdst") - self.delay_slot_set = m2_expr.ExprId("branch_dst_set") + self.delay_slot_dst = m2_expr.ExprId("branch_dst_irdst", 32) + self.delay_slot_set = m2_expr.ExprId("branch_dst_set", 32) def block2assignblks(self, block): irblocks_list = super(mipsCGen, self).block2assignblks(block) @@ -58,7 +58,7 @@ class mipsCGen(CGen): assignments[self.delay_slot_set] = m2_expr.ExprInt(1, 32) # Replace IRDst with next instruction assignments[self.ir_arch.IRDst] = m2_expr.ExprId( - self.ir_arch.get_next_instr(assignblock.instr)) + self.ir_arch.get_next_instr(assignblock.instr), 32) irs.append(AssignBlock(assignments, assignblock.instr)) irblocks[blk_idx] = IRBlock(irblock.label, irs) @@ -72,8 +72,8 @@ class mipsCGen(CGen): lbl = self.get_block_post_label(block) out = (self.CODE_RETURN_NO_EXCEPTION % (self.label_to_jitlabel(lbl), self.C_PC, - m2_expr.ExprId('branch_dst_irdst'), - m2_expr.ExprId('branch_dst_irdst'), + m2_expr.ExprId('branch_dst_irdst', 32), + m2_expr.ExprId('branch_dst_irdst', 32), self.id_to_c(m2_expr.ExprInt(lbl.offset, 32))) ).split('\n') return out diff --git a/miasm2/arch/mips32/regs.py b/miasm2/arch/mips32/regs.py index fbd55a46..afade869 100644 --- a/miasm2/arch/mips32/regs.py +++ b/miasm2/arch/mips32/regs.py @@ -12,8 +12,8 @@ gen_reg('R_HI', globals()) exception_flags = ExprId('exception_flags', 32) -PC_init = ExprId("PC_init") -PC_FETCH_init = ExprId("PC_FETCH_init") +PC_init = ExprId("PC_init", 32) +PC_FETCH_init = ExprId("PC_FETCH_init", 32) regs32_str = ["ZERO", 'AT', 'V0', 'V1'] +\ ['A%d'%i for i in xrange(4)] +\ diff --git a/miasm2/arch/mips32/sem.py b/miasm2/arch/mips32/sem.py index 645f9a4f..855cb6c8 100644 --- a/miasm2/arch/mips32/sem.py +++ b/miasm2/arch/mips32/sem.py @@ -34,7 +34,7 @@ def jal(arg1): "Jumps to the calculated address @arg1 and stores the return address in $RA" PC = arg1 ir.IRDst = arg1 - RA = ExprId(ir.get_next_break_label(instr)) + RA = ExprId(ir.get_next_break_label(instr), 32) @sbuild.parse def jalr(arg1, arg2): @@ -42,13 +42,13 @@ def jalr(arg1, arg2): address in another register @arg2""" PC = arg1 ir.IRDst = arg1 - arg2 = ExprId(ir.get_next_break_label(instr)) + arg2 = ExprId(ir.get_next_break_label(instr), 32) @sbuild.parse def bal(arg1): PC = arg1 ir.IRDst = arg1 - RA = ExprId(ir.get_next_break_label(instr)) + RA = ExprId(ir.get_next_break_label(instr), 32) @sbuild.parse def l_b(arg1): @@ -75,7 +75,7 @@ def lb(arg1, arg2): @sbuild.parse def beq(arg1, arg2, arg3): "Branches on @arg3 if the quantities of two registers @arg1, @arg2 are eq" - dst = ExprId(ir.get_next_break_label(instr)) if arg1 - arg2 else arg3 + dst = ExprId(ir.get_next_break_label(instr), 32) if arg1 - arg2 else arg3 PC = dst ir.IRDst = dst @@ -83,7 +83,7 @@ def beq(arg1, arg2, arg3): def bgez(arg1, arg2): """Branches on @arg2 if the quantities of register @arg1 is greater than or equal to zero""" - dst = ExprId(ir.get_next_break_label(instr)) if arg1.msb() else arg2 + dst = ExprId(ir.get_next_break_label(instr), 32) if arg1.msb() else arg2 PC = dst ir.IRDst = dst @@ -91,7 +91,7 @@ def bgez(arg1, arg2): def bne(arg1, arg2, arg3): """Branches on @arg3 if the quantities of two registers @arg1, @arg2 are NOT equal""" - dst = arg3 if arg1 - arg2 else ExprId(ir.get_next_break_label(instr)) + dst = arg3 if arg1 - arg2 else ExprId(ir.get_next_break_label(instr), 32) PC = dst ir.IRDst = dst @@ -229,7 +229,7 @@ def seh(arg1, arg2): @sbuild.parse def bltz(arg1, arg2): """Branches on @arg2 if the register @arg1 is less than zero""" - dst_o = arg2 if arg1.msb() else ExprId(ir.get_next_break_label(instr)) + dst_o = arg2 if arg1.msb() else ExprId(ir.get_next_break_label(instr), 32) PC = dst_o ir.IRDst = dst_o @@ -237,7 +237,7 @@ def bltz(arg1, arg2): def blez(arg1, arg2): """Branches on @arg2 if the register @arg1 is less than or equal to zero""" cond = (i1(1) if arg1 else i1(0)) | arg1.msb() - dst_o = arg2 if cond else ExprId(ir.get_next_break_label(instr)) + dst_o = arg2 if cond else ExprId(ir.get_next_break_label(instr), 32) PC = dst_o ir.IRDst = dst_o @@ -245,7 +245,7 @@ def blez(arg1, arg2): def bgtz(arg1, arg2): """Branches on @arg2 if the register @arg1 is greater than zero""" cond = (i1(1) if arg1 else i1(0)) | arg1.msb() - dst_o = ExprId(ir.get_next_break_label(instr)) if cond else arg2 + dst_o = ExprId(ir.get_next_break_label(instr), 32) if cond else arg2 PC = dst_o ir.IRDst = dst_o @@ -345,13 +345,13 @@ def c_le_d(arg1, arg2, arg3): @sbuild.parse def bc1t(arg1, arg2): - dst_o = arg2 if arg1 else ExprId(ir.get_next_break_label(instr)) + dst_o = arg2 if arg1 else ExprId(ir.get_next_break_label(instr), 32) PC = dst_o ir.IRDst = dst_o @sbuild.parse def bc1f(arg1, arg2): - dst_o = ExprId(ir.get_next_break_label(instr)) if arg1 else arg2 + dst_o = ExprId(ir.get_next_break_label(instr), 32) if arg1 else arg2 PC = dst_o ir.IRDst = dst_o |