[pypy-svn] r63650 - in pypy/branch/pyjitpl5-simplify/pypy/jit: backend/llgraph backend/test backend/x86 metainterp
fijal at codespeak.net
fijal at codespeak.net
Sun Apr 5 02:34:23 CEST 2009
Author: fijal
Date: Sun Apr 5 02:34:23 2009
New Revision: 63650
Modified:
pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/llimpl.py
pypy/branch/pyjitpl5-simplify/pypy/jit/backend/test/runner.py
pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/regalloc.py
pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/executor.py
pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/pyjitpl.py
pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/resoperation.py
Log:
cast_unichar_to_int
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/llimpl.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/llimpl.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/llimpl.py Sun Apr 5 02:34:23 2009
@@ -115,6 +115,7 @@
'strgetitem' : (('ptr', 'int'), 'int'),
'strsetitem' : (('ptr', 'int', 'int'), None),
'cast_ptr_to_int' : (('ptr',), 'int'),
+ 'cast_unichar_to_int' : (('int',), 'int'),
'cast_int_to_ptr' : (('int',), 'ptr'),
#'getitem' : (('void', 'ptr', 'int'), 'int'),
#'setitem' : (('void', 'ptr', 'int', 'int'), None),
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/test/runner.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/test/runner.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/test/runner.py Sun Apr 5 02:34:23 2009
@@ -75,6 +75,10 @@
res2 = self.execute_operation(rop.CAST_INT_TO_PTR,
[BoxInt(res)], 'ptr').value
assert res2 == x
+ x = execute(self.cpu, rop.CAST_UNICHAR_TO_INT, [BoxInt(1234)])
+ assert x.value == 1234
+ assert self.execute_operation(rop.CAST_UNICHAR_TO_INT,
+ [BoxInt(1234)], 'int').value == 1234
def test_uint_xor(self):
x = execute(self.cpu, rop.UINT_XOR, [BoxInt(100), ConstInt(4)])
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/regalloc.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/regalloc.py Sun Apr 5 02:34:23 2009
@@ -949,6 +949,7 @@
consider_cast_int_to_ptr = _same_as
consider_cast_ptr_to_int = _same_as
+ consider_cast_unichar_to_int = _same_as
xxx_consider_cast_int_to_char = _same_as
xxx_consider_cast_int_to_ptr = _same_as
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/executor.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/executor.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/executor.py Sun Apr 5 02:34:23 2009
@@ -88,6 +88,9 @@
def do_uint_ge(cpu, args, descr=None):
return ConstInt(r_uint(args[0].getint()) >= r_uint(args[1].getint()))
+def do_cast_unichar_to_int(cpu, args, descr=None):
+ return args[0].clonebox()
+
# ----------
def do_int_is_true(cpu, args, descr=None):
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/pyjitpl.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/pyjitpl.py Sun Apr 5 02:34:23 2009
@@ -255,6 +255,7 @@
for _opimpl in ['int_is_true', 'int_neg', 'int_invert', 'bool_not',
'uint_is_true', 'cast_ptr_to_int', 'cast_int_to_ptr',
+ 'cast_unichar_to_int',
]:
exec py.code.Source('''
@arguments("box")
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/resoperation.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/resoperation.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/resoperation.py Sun Apr 5 02:34:23 2009
@@ -105,7 +105,8 @@
#
CAST_INT_TO_PTR = 21
CAST_PTR_TO_INT = 22
- UINT_XOR = 23
+ CAST_UNICHAR_TO_INT = 23
+ UINT_XOR = 24
INT_ADD = 30
INT_SUB = 31
INT_MUL = 32
More information about the Pypy-commit
mailing list