[pypy-svn] r62906 - in pypy/branch/pyjitpl5/pypy/jit/backend/x86: . test

fijal at codespeak.net fijal at codespeak.net
Thu Mar 12 20:41:10 CET 2009


Author: fijal
Date: Thu Mar 12 20:41:08 2009
New Revision: 62906

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_regalloc.py
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_runner.py
Log:
a bit of fixes


Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py	Thu Mar 12 20:41:08 2009
@@ -268,15 +268,21 @@
                 self.mc.CMP(arglocs[1], arglocs[0])
                 if guard_op.opnum == rop.GUARD_FALSE:
                     name = 'J' + rev_cond
+                    self.implement_guard(guard_op, getattr(self.mc, name),
+                                         arglocs[2:])
                 else:
                     name = 'J' + false_rev_cond
+                    self.implement_guard(guard_op, getattr(self.mc, name),
+                                         arglocs[2:])
             else:
                 self.mc.CMP(arglocs[0], arglocs[1])
                 if guard_op.opnum == rop.GUARD_FALSE:
-                    name = 'J' + cond
+                    self.implement_guard(guard_op, getattr(self.mc, 'J' + cond),
+                                         arglocs[2:])
                 else:
                     name = 'J' + false_cond
-            self.implement_guard(guard_op, getattr(self.mc, name), arglocs[2:])
+                    self.implement_guard(guard_op, getattr(self.mc, name),
+                                         arglocs[2:])
         return genop_cmp_guard
             
 

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py	Thu Mar 12 20:41:08 2009
@@ -212,6 +212,8 @@
         if (operations[i + 1].opnum != rop.GUARD_TRUE and
             operations[i + 1].opnum != rop.GUARD_FALSE):
             return False
+        if operations[i + 1].args[0] is not op.result:
+            return False
         if self.longevity[op.result][1] > i + 1:
             return False
         return True

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_regalloc.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_regalloc.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_regalloc.py	Thu Mar 12 20:41:08 2009
@@ -117,15 +117,15 @@
         ResOperation(rop.JUMP, [x, z, y, i0], None),
         ]
     operations[-1].jump_target = operations[0]
-    operations[3].liveboxes = [v0, x, y, z, i0]
+    operations[3].liveboxes = [x, y, z, i0]
 
     cpu.compile_operations(operations)
 
     res = cpu.execute_operations_in_new_frame('foo', operations,
                                                    [BoxInt(1), BoxInt(2),
                                                     BoxInt(3), BoxInt(10)])
-    assert res.value == 0
-    assert meta_interp.recordedvalues == [0, 1, 3, 2, 0]
+    assert res.value == 1
+    assert meta_interp.recordedvalues == [1, 3, 2, 0]
 
 def test_bool_optimizations():
     meta_interp = FakeMetaInterp()

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_runner.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_runner.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_runner.py	Thu Mar 12 20:41:08 2009
@@ -144,13 +144,13 @@
             ]
         startmp = operations[0]
         operations[-1].jump_target = startmp
-        operations[-2].liveboxes = [t, u, z]
+        operations[-2].liveboxes = [t, z]
         cpu.compile_operations(operations)
         res = self.cpu.execute_operations_in_new_frame('foo', operations,
                                                        [BoxInt(0), BoxInt(10)])
         assert res.value == 0
         gf = cpu.metainterp.gf
-        assert cpu.metainterp.recordedvalues == [0, True, 55]
+        assert cpu.metainterp.recordedvalues == [0, 55]
         assert gf.guard_op is operations[-2]
 
     def test_passing_guards(self):



More information about the Pypy-commit mailing list