[pypy-svn] r35390 - in pypy/branch/jit-real-world/pypy/jit: codegen/i386 timeshifter/test

arigo at codespeak.net arigo at codespeak.net
Wed Dec 6 14:06:08 CET 2006


Author: arigo
Date: Wed Dec  6 14:06:07 2006
New Revision: 35390

Modified:
   pypy/branch/jit-real-world/pypy/jit/codegen/i386/rgenop.py
   pypy/branch/jit-real-world/pypy/jit/timeshifter/test/test_timeshift.py
Log:
Fix a test.  Add comments about missing operations in i386/rgenop.
Skip tests trying to use floats in i386/rgenop.


Modified: pypy/branch/jit-real-world/pypy/jit/codegen/i386/rgenop.py
==============================================================================
--- pypy/branch/jit-real-world/pypy/jit/codegen/i386/rgenop.py	(original)
+++ pypy/branch/jit-real-world/pypy/jit/codegen/i386/rgenop.py	Wed Dec  6 14:06:07 2006
@@ -1,4 +1,4 @@
-import sys
+import sys, py
 from pypy.rlib.objectmodel import specialize
 from pypy.rpython.lltypesystem import lltype, llmemory
 from pypy.jit.codegen.i386.ri386 import *
@@ -218,7 +218,6 @@
 
 class Builder(GenBuilder):
 
-
     def __init__(self, rgenop, mc, stackdepth):
         self.rgenop = rgenop
         self.stackdepth = stackdepth
@@ -362,7 +361,7 @@
             self.mc.CALL(rel32(target))
         else:
             self.mc.CALL(gv_fnptr.operand(self))
-        # XXX only for int return_kind
+        # XXX only for int return_kind, check calling conventions
         return self.returnvar(eax)
 
     def genop_same_as(self, kind, gv_x):
@@ -551,13 +550,13 @@
 
     def op_int_lshift(self, gv_x, gv_y):
         self.mc.MOV(eax, gv_x.operand(self))
-        self.mc.MOV(ecx, gv_y.operand(self))
+        self.mc.MOV(ecx, gv_y.operand(self))   # XXX check if ecx >= 32
         self.mc.SHL(eax, cl)
         return self.returnvar(eax)
 
     def op_int_rshift(self, gv_x, gv_y):
         self.mc.MOV(eax, gv_x.operand(self))
-        self.mc.MOV(ecx, gv_y.operand(self))
+        self.mc.MOV(ecx, gv_y.operand(self))   # XXX check if ecx >= 32
         self.mc.SAR(eax, cl)
         return self.returnvar(eax)
 
@@ -621,7 +620,7 @@
 
     def op_uint_rshift(self, gv_x, gv_y):
         self.mc.MOV(eax, gv_x.operand(self))
-        self.mc.MOV(ecx, gv_y.operand(self))
+        self.mc.MOV(ecx, gv_y.operand(self))   # XXX check if ecx >= 32
         self.mc.SHR(eax, cl)
         return self.returnvar(eax)
 
@@ -960,7 +959,7 @@
     @specialize.memo()
     def kindToken(T):
         if T is lltype.Float:
-            raise NotImplementedError("floats in the i386 back-end")
+            py.test.skip("not implemented: floats in the i386 back-end")
         return None     # for now
 
     @staticmethod

Modified: pypy/branch/jit-real-world/pypy/jit/timeshifter/test/test_timeshift.py
==============================================================================
--- pypy/branch/jit-real-world/pypy/jit/timeshifter/test/test_timeshift.py	(original)
+++ pypy/branch/jit-real-world/pypy/jit/timeshifter/test/test_timeshift.py	Wed Dec  6 14:06:07 2006
@@ -688,8 +688,9 @@
             s = lltype.malloc(S)
             s.x = 123
             return s
+        ll_function.convert_result = lambda s: str(s.x)
         res = self.timeshift(ll_function, [], [], policy=P_NOVIRTUAL)
-        assert res.x == 123
+        assert res == "123"
 
     def test_plus_minus_all_inlined(self):
         def ll_plus_minus(s, x, y):



More information about the Pypy-commit mailing list