[pypy-svn] r64600 - in pypy/branch/pyjitpl5/pypy/jit: backend/x86 metainterp

arigo at codespeak.net arigo at codespeak.net
Thu Apr 23 17:12:51 CEST 2009


Author: arigo
Date: Thu Apr 23 17:12:51 2009
New Revision: 64600

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/executor.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/resoperation.py
Log:
Porting r64598.


Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py	Thu Apr 23 17:12:51 2009
@@ -406,12 +406,6 @@
     genop_int_or  = _binaryop("OR", True)
     genop_int_xor = _binaryop("XOR", True)
 
-    genop_uint_add = genop_int_add
-    genop_uint_sub = genop_int_sub
-    genop_uint_mul = genop_int_mul
-    genop_uint_xor = genop_int_xor
-    genop_uint_and = genop_int_and
-
     genop_guard_int_mul_ovf = _binaryop_ovf("IMUL", True)
     genop_guard_int_sub_ovf = _binaryop_ovf("SUB")
     genop_guard_int_add_ovf = _binaryop_ovf("ADD", True)

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py	Thu Apr 23 17:12:51 2009
@@ -721,11 +721,6 @@
     consider_int_and = _consider_binop
     consider_int_or  = _consider_binop
     consider_int_xor = _consider_binop
-    consider_uint_xor = _consider_binop
-    consider_uint_add = _consider_binop
-    consider_uint_mul = _consider_binop
-    consider_uint_sub = _consider_binop
-    consider_uint_and = _consider_binop
     
     def _consider_binop_ovf(self, op, guard_op):
         loc, argloc = self._consider_binop_part(op, None)

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py	Thu Apr 23 17:12:51 2009
@@ -571,6 +571,17 @@
     def serialize_op_char_le(self, op): self._defl(op, 'int_le')
     def serialize_op_char_lt(self, op): self._defl(op, 'int_lt')
 
+    def serialize_op_uint_eq(self, op): self._defl(op, 'int_eq')
+    def serialize_op_uint_ne(self, op): self._defl(op, 'int_ne')
+
+    def serialize_op_uint_add(self, op): self._defl(op, 'int_add')
+    def serialize_op_uint_sub(self, op): self._defl(op, 'int_sub')
+    def serialize_op_uint_mul(self, op): self._defl(op, 'int_mul')
+    def serialize_op_uint_and(self, op): self._defl(op, 'int_and')
+    def serialize_op_uint_or (self, op): self._defl(op, 'int_or')
+    def serialize_op_uint_xor(self, op): self._defl(op, 'int_xor')
+    def serialize_op_uint_lshift(self, op): self._defl(op, 'int_lshift')
+
     serialize_op_unichar_eq = serialize_op_char_eq
     serialize_op_unichar_ne = serialize_op_char_ne
 

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/executor.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/executor.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/executor.py	Thu Apr 23 17:12:51 2009
@@ -18,13 +18,13 @@
 # ____________________________________________________________
 
 def do_int_add(cpu, args, descr=None):
-    return ConstInt(args[0].getint() + args[1].getint())
+    return ConstInt(intmask(args[0].getint() + args[1].getint()))
 
 def do_int_sub(cpu, args, descr=None):
-    return ConstInt(args[0].getint() - args[1].getint())
+    return ConstInt(intmask(args[0].getint() - args[1].getint()))
 
 def do_int_mul(cpu, args, descr=None):
-    return ConstInt(args[0].getint() * args[1].getint())
+    return ConstInt(intmask(args[0].getint() * args[1].getint()))
 
 def do_int_floordiv(cpu, args, descr=None):
     z = llop.int_floordiv(lltype.Signed, args[0].getint(), args[1].getint())
@@ -47,21 +47,14 @@
     return ConstInt(args[0].getint() >> args[1].getint())
 
 def do_int_lshift(cpu, args, descr=None):
-    return ConstInt(args[0].getint() << args[1].getint())
-
-do_uint_add = do_int_add
-do_uint_sub = do_int_sub
-do_uint_mul = do_int_mul
-do_uint_lshift = do_int_lshift
-do_uint_xor = do_int_xor
-do_uint_and = do_int_and
+    return ConstInt(intmask(args[0].getint() << args[1].getint()))
 
 def do_uint_rshift(cpu, args, descr=None):
     v = r_uint(args[0].getint()) >> r_uint(args[1].getint())
     return ConstInt(intmask(v))
 
 def do_int_abs(cpu, args, descr=None):
-    return ConstInt(abs(args[0].getint()))
+    return ConstInt(intmask(abs(args[0].getint())))
 
 # ----------
 
@@ -89,9 +82,6 @@
 def do_uint_le(cpu, args, descr=None):
     return ConstInt(r_uint(args[0].getint()) <= r_uint(args[1].getint()))
 
-do_uint_eq = do_int_eq
-do_uint_ne = do_int_ne
-
 def do_uint_gt(cpu, args, descr=None):
     return ConstInt(r_uint(args[0].getint()) > r_uint(args[1].getint()))
 
@@ -103,10 +93,8 @@
 def do_int_is_true(cpu, args, descr=None):
     return ConstInt(bool(args[0].getint()))
 
-do_uint_is_true = do_int_is_true
-
 def do_int_neg(cpu, args, descr=None):
-    return ConstInt(-args[0].getint())
+    return ConstInt(intmask(-args[0].getint()))
 
 def do_int_invert(cpu, args, descr=None):
     return ConstInt(~args[0].getint())

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py	Thu Apr 23 17:12:51 2009
@@ -250,11 +250,9 @@
     for _opimpl in ['int_add', 'int_sub', 'int_mul', 'int_floordiv', 'int_mod',
                     'int_lt', 'int_le', 'int_eq',
                     'int_ne', 'int_gt', 'int_ge',
-                    'int_and', 'int_or', 'int_xor', 'uint_xor',
-                    'int_rshift', 'int_lshift', 'uint_lshift', 'uint_rshift',
-                    'uint_add', 'uint_sub', 'uint_mul',
-                    'uint_lt', 'uint_le', 'uint_eq',
-                    'uint_ne', 'uint_gt', 'int_ge', 'uint_and',
+                    'int_and', 'int_or', 'int_xor',
+                    'int_rshift', 'int_lshift', 'uint_rshift',
+                    'uint_lt', 'uint_le', 'uint_gt', 'uint_ge',
                     ]:
         exec py.code.Source('''
             @arguments("box", "box")
@@ -271,7 +269,7 @@
         ''' % (_opimpl, _opimpl.upper())).compile()
 
     for _opimpl in ['int_is_true', 'int_neg', 'int_invert', 'bool_not',
-                    'uint_is_true', 'cast_ptr_to_int', 'cast_int_to_ptr',
+                    'cast_ptr_to_int', 'cast_int_to_ptr',
                     'int_abs',
                     ]:
         exec py.code.Source('''

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/resoperation.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/resoperation.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/resoperation.py	Thu Apr 23 17:12:51 2009
@@ -104,8 +104,6 @@
     #
     CAST_INT_TO_PTR        = 21
     CAST_PTR_TO_INT        = 22
-    UINT_AND               = 23
-    UINT_XOR               = 29
     INT_ADD                = 30
     INT_SUB                = 31
     INT_MUL                = 32
@@ -116,10 +114,6 @@
     INT_XOR                = 37
     INT_RSHIFT             = 38
     INT_LSHIFT             = 39
-    UINT_ADD               = 40
-    UINT_SUB               = 41
-    UINT_MUL               = 42
-    UINT_LSHIFT            = 43
     UINT_RSHIFT            = 44
     #
     _COMPARISON_FIRST = 45
@@ -131,8 +125,6 @@
     INT_GE                 = 50
     UINT_LT                = 51
     UINT_LE                = 52
-    UINT_EQ                = 53
-    UINT_NE                = 54
     UINT_GT                = 55
     UINT_GE                = 56
     _COMPARISON_LAST = 56
@@ -141,7 +133,6 @@
     INT_NEG                = 61
     INT_INVERT             = 62
     BOOL_NOT               = 63
-    UINT_IS_TRUE           = 64
     INT_ABS                = 65
     #
     OONONNULL              = 70



More information about the Pypy-commit mailing list