[pypy-svn] r75294 - in pypy/branch/int-between/pypy/jit: codewriter metainterp/test

arigo at codespeak.net arigo at codespeak.net
Fri Jun 11 23:04:01 CEST 2010


Author: arigo
Date: Fri Jun 11 23:04:00 2010
New Revision: 75294

Modified:
   pypy/branch/int-between/pypy/jit/codewriter/jtransform.py
   pypy/branch/int-between/pypy/jit/metainterp/test/test_basic.py
Log:
Merge r75293 from trunk.


Modified: pypy/branch/int-between/pypy/jit/codewriter/jtransform.py
==============================================================================
--- pypy/branch/int-between/pypy/jit/codewriter/jtransform.py	(original)
+++ pypy/branch/int-between/pypy/jit/codewriter/jtransform.py	Fri Jun 11 23:04:00 2010
@@ -140,7 +140,6 @@
                 if op.opname not in ('int_lt', 'int_le', 'int_eq', 'int_ne',
                                      'int_gt', 'int_ge',
                                      'int_is_zero', 'int_is_true',
-                                     'uint_lt','uint_le','uint_gt','uint_ge',
                                      'ptr_eq', 'ptr_ne',
                                      'ptr_iszero', 'ptr_nonzero'):
                     return False    # not a supported operation

Modified: pypy/branch/int-between/pypy/jit/metainterp/test/test_basic.py
==============================================================================
--- pypy/branch/int-between/pypy/jit/metainterp/test/test_basic.py	(original)
+++ pypy/branch/int-between/pypy/jit/metainterp/test/test_basic.py	Fri Jun 11 23:04:00 2010
@@ -551,6 +551,19 @@
                                       int_le=0, uint_le=1,
                                       int_sub=1)
 
+    def test_uint_condition(self):
+        from pypy.rlib.rarithmetic import r_uint
+        def f(n):
+            if ((r_uint(n) - 123) >> 1) <= r_uint(456):
+                return 24
+            else:
+                return 12
+        res = self.interp_operations(f, [50])
+        assert res == 12
+        self.check_operations_history(int_rshift=0, uint_rshift=1,
+                                      int_le=0, uint_le=1,
+                                      int_sub=1)
+
     def test_int_between(self):
         #
         def check(arg1, arg2, arg3, expect_result, **expect_operations):



More information about the Pypy-commit mailing list