Author: David Schneider <david.schnei...@picle.org> Branch: arm-backend-2 Changeset: r47705:222f53104914 Date: 2011-09-29 13:10 +0200 http://bitbucket.org/pypy/pypy/changeset/222f53104914/
Log: add more tests for unsupported cases when moving between locations diff --git a/pypy/jit/backend/arm/assembler.py b/pypy/jit/backend/arm/assembler.py --- a/pypy/jit/backend/arm/assembler.py +++ b/pypy/jit/backend/arm/assembler.py @@ -862,7 +862,7 @@ self.mc.VLDR(loc.value, r.ip.value) def _mov_imm_to_loc(self, prev_loc, loc, cond=c.AL): - if not loc.is_reg() and not loc.is_stack(): + if not loc.is_reg() and not (loc.is_stack() and loc.type == INT): raise AssertionError("invalid target for move from imm value") if loc.is_reg(): new_loc = loc @@ -881,7 +881,7 @@ raise AssertionError("mov reg to imm doesn't make sense") if loc.is_reg(): self.mc.MOV_rr(loc.value, prev_loc.value, cond=cond) - elif loc.is_stack(): + elif loc.is_stack() and loc.type == INT: # spill a core register offset = ConstInt(loc.position*WORD) if not _check_imm_arg(offset, size=0xFFF): diff --git a/pypy/jit/backend/arm/test/test_regalloc_mov.py b/pypy/jit/backend/arm/test/test_regalloc_mov.py --- a/pypy/jit/backend/arm/test/test_regalloc_mov.py +++ b/pypy/jit/backend/arm/test/test_regalloc_mov.py @@ -214,22 +214,25 @@ py.test.raises(AssertionError, 'self.asm.regalloc_mov(imm(1), imm(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(imm(1), imm_float(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(imm(1), vfp(2))') + py.test.raises(AssertionError, 'self.asm.regalloc_mov(imm(1), stack_float(2))') + py.test.raises(AssertionError, 'self.asm.regalloc_mov(imm_float(1), imm(2))') + py.test.raises(AssertionError, 'self.asm.regalloc_mov(imm_float(1), imm_float(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(imm_float(1), r(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(imm_float(1), stack(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(imm_float(1), stack_float(2))') - py.test.raises(AssertionError, 'self.asm.regalloc_mov(imm_float(1), imm_float(2))') - py.test.raises(AssertionError, 'self.asm.regalloc_mov(imm_float(1), imm(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(r(1), imm(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(r(1), imm_float(2))') - py.test.raises(AssertionError, 'self.asm.regalloc_mov(vfp(1), imm(2))') - py.test.raises(AssertionError, 'self.asm.regalloc_mov(vfp(1), imm_float(2))') + py.test.raises(AssertionError, 'self.asm.regalloc_mov(r(1), stack_float(2))') + py.test.raises(AssertionError, 'self.asm.regalloc_mov(r(1), vfp(2))') + py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack(1), imm(2))') + py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack(1), imm_float(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack(1), stack(2))') - py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack(1), imm_float(2))') - py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack(1), imm(2))') + py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack(1), stack_float(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack(1), vfp(2))') - py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack_float(1), r(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack_float(1), imm(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack_float(1), imm_float(2))') + py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack_float(1), r(2))') + py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack_float(1), stack(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(stack_float(1), stack_float(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(vfp(1), imm(2))') py.test.raises(AssertionError, 'self.asm.regalloc_mov(vfp(1), imm_float(2))') _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit