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

fijal at codespeak.net fijal at codespeak.net
Fri Apr 24 07:31:22 CEST 2009


Author: fijal
Date: Fri Apr 24 07:31:22 2009
New Revision: 64626

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/test/runner.py
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/runner.py
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_runner.py
Log:
fix the test


Modified: pypy/branch/pyjitpl5/pypy/jit/backend/test/runner.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/test/runner.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/test/runner.py	Fri Apr 24 07:31:22 2009
@@ -25,6 +25,10 @@
                                                   valueboxes, descr)
         boxes = [box for box in valueboxes if isinstance(box, Box)]
         res = self.cpu.execute_operations(loop, boxes)
+        if res is loop.operations[-1]:
+            self.guard_failed = False
+        else:
+            self.guard_failed = True
         if result_type != 'void':
             return res.args[0]
 
@@ -231,15 +235,6 @@
 ##                op = self.cpu.execute_operations(loop, [BoxInt(x), BoxInt(y)])
 ##                assert op.args[0].value == z
 
-    def test_uint_xor(self):
-        x = execute(self.cpu, rop.UINT_XOR, [BoxInt(100), ConstInt(4)])
-        assert x.value == 100 ^ 4
-        for a, b in [(ConstInt(1), BoxInt(-15)),
-                     (BoxInt(22), BoxInt(13)),
-                     (BoxInt(-112), ConstInt(11))]:
-            res = self.execute_operation(rop.UINT_XOR, [a, b], 'int')
-            assert res.value == intmask(r_uint(a.value) ^ r_uint(b.value))
-
     def test_ooops_non_gc(self):
         x = lltype.malloc(lltype.Struct('x'), flavor='raw')
         v = self.cpu.cast_adr_to_int(llmemory.cast_ptr_to_adr(x))
@@ -265,7 +260,7 @@
                                #(rop.GUARD_VALUE_INVERSE, [BoxInt(42), BoxInt(41)]),
                                ]:
             assert self.execute_operation(opname, args, 'void') == None
-            assert not self.cpu.guard_failed()
+            assert not self.guard_failed
             
         t = lltype.malloc(T)
         t.parent.parent.typeptr = vtable_for_T
@@ -273,7 +268,7 @@
         T_box = ConstInt(cpu.cast_adr_to_int(vtable_for_T_addr))
         null_box = ConstPtr(lltype.cast_opaque_ptr(llmemory.GCREF, lltype.nullptr(T)))
         self.execute_operation(rop.GUARD_CLASS, [t_box, T_box], 'void')
-        assert not self.cpu.guard_failed()
+        assert not self.guard_failed
         #self.execute_operation(rop.GUARD_CLASS_INVERSE, [t_box, null_box],
         #                       'void')
 
@@ -301,6 +296,6 @@
                              #(rop.GUARD_VALUE_INVERSE, [BoxInt(10), BoxInt(10)]),
                              ]:
             assert self.execute_operation(opname, args, 'void') == None
-            assert self.cpu.guard_failed()
+            assert self.guard_failed
 
             

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/runner.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/runner.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/runner.py	Fri Apr 24 07:31:22 2009
@@ -656,10 +656,6 @@
         assert x == 0 or x > (1<<20) or x < (-1<<20)
         return rffi.cast(llmemory.GCREF, x)
 
-    # ---------------------------- tests ------------------------
-    def guard_failed(self):
-        return self._guard_index != -1
-
 def uhex(x):
     if we_are_translated():
         return hex(x)

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	Fri Apr 24 07:31:22 2009
@@ -1,5 +1,4 @@
 import py
-py.test.skip("fixme")
 from pypy.rpython.lltypesystem import lltype, llmemory, rffi, rstr, rclass
 from pypy.jit.metainterp.history import ResOperation, TreeLoop
 from pypy.jit.metainterp.history import (BoxInt, BoxPtr, ConstInt, ConstPtr,
@@ -307,16 +306,6 @@
 
         arg0 = BoxInt(intmask(r_uint(sys.maxint + 3)))
         arg1 = BoxInt(intmask(r_uint(4)))
-        res = self.execute_operation(rop.UINT_ADD, [arg0, arg1], 'int')
-        assert res.value == intmask(r_uint(sys.maxint + 3) + r_uint(4))
-
-        arg0 = BoxInt(intmask(sys.maxint + 10))
-        arg1 = BoxInt(10)
-        res = self.execute_operation(rop.UINT_MUL, [arg0, arg1], 'int')
-        assert res.value == intmask((sys.maxint + 10) * 10)
-
-        arg0 = BoxInt(intmask(r_uint(sys.maxint + 3)))
-        arg1 = BoxInt(intmask(r_uint(4)))
 
         res = self.execute_operation(rop.UINT_GT, [arg0, arg1], 'int')
         assert res.value == 1



More information about the Pypy-commit mailing list