[pypy-svn] r75293 - in pypy/trunk/pypy/jit: codewriter metainterp/test

arigo at codespeak.net arigo at codespeak.net
Fri Jun 11 22:46:35 CEST 2010


Author: arigo
Date: Fri Jun 11 22:46:33 2010
New Revision: 75293

Modified:
   pypy/trunk/pypy/jit/codewriter/jtransform.py
   pypy/trunk/pypy/jit/metainterp/test/test_basic.py
Log:
Test and fix (for now by not having goto_if_not_uint_xx comparison
operators, but only uint_xx).


Modified: pypy/trunk/pypy/jit/codewriter/jtransform.py
==============================================================================
--- pypy/trunk/pypy/jit/codewriter/jtransform.py	(original)
+++ pypy/trunk/pypy/jit/codewriter/jtransform.py	Fri Jun 11 22:46:33 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/trunk/pypy/jit/metainterp/test/test_basic.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/test/test_basic.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/test/test_basic.py	Fri Jun 11 22:46:33 2010
@@ -548,6 +548,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_getfield(self):
         class A:
             pass



More information about the Pypy-commit mailing list