[pypy-svn] r62224 - pypy/branch/pyjitpl5/pypy/jit/backend/llgraph

arigo at codespeak.net arigo at codespeak.net
Fri Feb 27 14:46:04 CET 2009


Author: arigo
Date: Fri Feb 27 14:46:03 2009
New Revision: 62224

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/llgraph/llimpl.py
Log:
Fix: always pass signed integers in the graphs produced by the JIT
(like we always pass GCREFs instead of pointers).  Muuuuch saner.

Other fix: 'int_ge' -> 'uint_ge'   :-(


Modified: pypy/branch/pyjitpl5/pypy/jit/backend/llgraph/llimpl.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/llgraph/llimpl.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/llgraph/llimpl.py	Fri Feb 27 14:46:03 2009
@@ -19,7 +19,7 @@
 from pypy.jit.backend.llgraph import symbolic
 
 from pypy.rlib.objectmodel import ComputedIntSymbolic
-from pypy.rlib.rarithmetic import r_uint
+from pypy.rlib.rarithmetic import r_uint, intmask
 
 import py
 from pypy.tool.ansi_print import ansi_log
@@ -586,18 +586,19 @@
 
     # ---------- signed/unsigned support ----------
 
-    # for these operations, allow us to be called with unsigned or with
-    # regular signed arguments (which would come e.g. from ConstInt)
+    # for these operations, we expect to be called with regular ints
+    # and to return regular ints
     for _opname in ['uint_add', 'uint_sub', 'uint_mul',
                     'uint_lt', 'uint_le', 'uint_eq',
-                    'uint_ne', 'uint_gt', 'int_ge',
+                    'uint_ne', 'uint_gt', 'uint_ge',
                     ]:
         exec py.code.Source("""
             def op_%s(self, x, y):
                 x = r_uint(x)
                 y = r_uint(y)
                 ophandler = lloperation.LL_OPERATIONS[%r].fold
-                return ophandler(x, y)
+                z = ophandler(x, y)
+                return intmask(z)
         """ % (_opname, _opname)).compile()
 
     # ----------------------------------------



More information about the Pypy-commit mailing list