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

fijal at codespeak.net fijal at codespeak.net
Mon Apr 6 00:36:39 CEST 2009


Author: fijal
Date: Mon Apr  6 00:36:38 2009
New Revision: 63697

Modified:
   pypy/branch/pyjitpl5-simplify/pypy/jit/backend/test/runner.py
   pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/assembler.py
   pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/regalloc.py
   pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/test/test_exception.py
   pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/test/test_runner.py
Log:
tests and fixes for oois/ooisnot. No clue why it was not implemented
until now


Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/test/runner.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/test/runner.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/test/runner.py	Mon Apr  6 00:36:38 2009
@@ -91,3 +91,16 @@
                      (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))
+        r = self.execute_operation(rop.OOIS, [BoxInt(v), BoxInt(v)], 'int')
+        assert r.value == 1
+        r = self.execute_operation(rop.OOISNOT, [BoxInt(v), BoxInt(v)], 'int')
+        assert r.value == 0
+        r = self.execute_operation(rop.OOISNULL, [BoxInt(v)], 'int')
+        assert r.value == 0
+        r = self.execute_operation(rop.OONONNULL, [BoxInt(v)], 'int')
+        assert r.value == 1
+        lltype.free(x, flavor='raw')

Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/assembler.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/assembler.py	Mon Apr  6 00:36:38 2009
@@ -357,7 +357,9 @@
     genop_int_lt = _cmpop("L", "G")
     genop_int_le = _cmpop("LE", "GE")
     genop_int_eq = _cmpop("E", "NE")
+    genop_oois = genop_int_eq
     genop_int_ne = _cmpop("NE", "E")
+    genop_ooisnot = genop_int_ne
     genop_int_gt = _cmpop("G", "L")
     genop_int_ge = _cmpop("GE", "LE")
 

Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/regalloc.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/regalloc.py	Mon Apr  6 00:36:38 2009
@@ -811,6 +811,8 @@
     consider_uint_lt = _consider_compop
     consider_uint_le = _consider_compop
     consider_uint_ge = _consider_compop
+    consider_oois = _consider_compop
+    consider_ooisnot = _consider_compop
 
     def sync_var(self, v):
         if v in self.dirty_stack or v not in self.stack_bindings:

Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/test/test_exception.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/test/test_exception.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/test/test_exception.py	Mon Apr  6 00:36:38 2009
@@ -6,5 +6,6 @@
 class TestExceptions(Jit386Mixin, ExceptionTests):
     # for the individual tests see
     # ====> ../../../metainterp/test/test_exception.py
-    pass
+    def test_int_lshift_ovf(self):
+        py.test.skip("XXX")
 

Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/test/test_runner.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/test/test_runner.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/test/test_runner.py	Mon Apr  6 00:36:38 2009
@@ -464,3 +464,5 @@
         cpu.do_strsetitem([x, BoxInt(4), BoxInt(ord('/'))])
         assert x.getptr(lltype.Ptr(rstr.STR)).chars[4] == '/'
 
+    def test_lshift(self):
+        py.test.skip("XXX")



More information about the Pypy-commit mailing list