[pypy-svn] r37792 - in pypy/dist/pypy/jit/codegen/ppc: . test
mwh at codespeak.net
mwh at codespeak.net
Fri Feb 2 11:14:04 CET 2007
Author: mwh
Date: Fri Feb 2 11:14:02 2007
New Revision: 37792
Modified:
pypy/dist/pypy/jit/codegen/ppc/emit_moves.py
pypy/dist/pypy/jit/codegen/ppc/rgenop.py
pypy/dist/pypy/jit/codegen/ppc/test/test_rgenop.py
Log:
add an ultra-inefficient ultra-safe version of emit_moves.
makes test_from_random_4_direct pass, the matching test of the more efficient
emit_moves is still skipped.
Modified: pypy/dist/pypy/jit/codegen/ppc/emit_moves.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/ppc/emit_moves.py (original)
+++ pypy/dist/pypy/jit/codegen/ppc/emit_moves.py Fri Feb 2 11:14:02 2007
@@ -92,3 +92,15 @@
gen.emit_move(tarloc, srcloc) # now safe to do our move
data.emitted.append(tarvar)
return
+
+def emit_moves_safe(gen, tarvars, tar2src, tar2loc, src2loc):
+ second_moves = []
+ for tarvar in tarvars:
+ srcvar = tar2src[tarvar]
+ srcloc = src2loc[srcvar]
+ freshloc = gen.create_fresh_location()
+ gen.emit_move(freshloc, srcloc)
+ second_moves.append((tar2loc[tarvar], freshloc))
+
+ for tarloc, freshloc in second_moves:
+ gen.emit_move(tarloc, freshloc)
Modified: pypy/dist/pypy/jit/codegen/ppc/rgenop.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/ppc/rgenop.py (original)
+++ pypy/dist/pypy/jit/codegen/ppc/rgenop.py Fri Feb 2 11:14:02 2007
@@ -12,7 +12,7 @@
from pypy.jit.codegen.ppc.instruction import rSP, rFP, rSCRATCH, gprs
from pypy.jit.codegen.ppc import instruction as insn
from pypy.jit.codegen.ppc.regalloc import RegisterAllocation
-from pypy.jit.codegen.ppc.emit_moves import emit_moves
+from pypy.jit.codegen.ppc.emit_moves import emit_moves, emit_moves_safe
from pypy.translator.asm.ppcgen.rassemblermaker import make_rassembler
from pypy.translator.asm.ppcgen.ppc_assembler import MyPPCAssembler
@@ -182,7 +182,7 @@
tarvars.append(tloc)
gen = JumpPatchupGenerator(insns, allocator)
- emit_moves(gen, tarvars, tar2src, tar2loc, src2loc)
+ emit_moves_safe(gen, tarvars, tar2src, tar2loc, src2loc)
for i in range(len(targetlocs)):
tloc = targetlocs[i]
Modified: pypy/dist/pypy/jit/codegen/ppc/test/test_rgenop.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/ppc/test/test_rgenop.py (original)
+++ pypy/dist/pypy/jit/codegen/ppc/test/test_rgenop.py Fri Feb 2 11:14:02 2007
@@ -25,9 +25,6 @@
def test_read_frame_place_direct(self): py.test.skip("in-progress")
def test_read_frame_place_compile(self): py.test.skip("in-progress")
- def test_from_random_4_direct(self):
- py.test.skip("failing :( -- see test_one_to_many in test_emit_moves")
-
class TestRPPCGenopNoRegs(TestRPPCGenop):
RGenOp = FewRegisters
More information about the pypy-svn
mailing list