[pypy-commit] pypy int-tag-untag-as-operations: can only untag odd ints

cfbolz noreply at buildbot.pypy.org
Fri Nov 25 12:54:18 CET 2011


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: int-tag-untag-as-operations
Changeset: r49785:b40390f48b0d
Date: 2011-11-17 10:31 +0100
http://bitbucket.org/pypy/pypy/changeset/b40390f48b0d/

Log:	can only untag odd ints

diff --git a/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py b/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py
--- a/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py
+++ b/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py
@@ -228,7 +228,10 @@
             args = []
             for argtype in argtypes:
                 assert argtype in ('int', 'bool')
-                args.append(random.randrange(1, 20))
+                arg = random.randrange(1, 20)
+                if opnum == rop.INT_UNTAG:
+                    arg = arg | 1 # must be an odd int
+                args.append(arg)
             assert restype in ('int', 'bool')
             ops = """
             []


More information about the pypy-commit mailing list