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

fijal at codespeak.net fijal at codespeak.net
Fri Apr 24 02:37:38 CEST 2009


Author: fijal
Date: Fri Apr 24 02:37:37 2009
New Revision: 64618

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_regalloc2.py
Log:
a fix to int_is_true.


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	Fri Apr 24 02:37:37 2009
@@ -1022,9 +1022,9 @@
     consider_cast_ptr_to_int = _same_as
 
     def consider_int_is_true(self, op, ignored):
-        argloc = self.force_allocate_reg(op.args[0], [])
+        argloc = self.make_sure_var_in_reg(op.args[0], [])
+        resloc = self.force_allocate_reg(op.result, op.args)
         self.eventually_free_var(op.args[0])
-        resloc = self.force_allocate_reg(op.result, [])
         self.Perform(op, [argloc], resloc)
 
     def consider_int_abs(self, op, ignored):

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_regalloc2.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_regalloc2.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_regalloc2.py	Fri Apr 24 02:37:37 2009
@@ -36,11 +36,12 @@
         ResOperation(rop.INT_MUL, [v2, v1], v3),
         ResOperation(rop.INT_IS_TRUE, [v2], tmp5),
         ResOperation(rop.BOOL_NOT, [tmp5], v4),
-        ResOperation(rop.FAIL, [v4, v3], None),
+        ResOperation(rop.FAIL, [v4, v3, tmp5], None),
             ]
     cpu = CPU(None, None)
     cpu.compile_operations(loop)
     cpu.execute_operations(loop, [BoxInt(-10)])
+    assert tmp5.value == 1
     assert v4.value == 0
     assert v3.value == -1000
 



More information about the Pypy-commit mailing list