[pypy-svn] r22821 - pypy/dist/pypy/jit

pedronis at codespeak.net pedronis at codespeak.net
Sun Jan 29 11:51:39 CET 2006


Author: pedronis
Date: Sun Jan 29 11:51:37 2006
New Revision: 22821

Modified:
   pypy/dist/pypy/jit/hintmodel.py
Log:
(arre, pedronis)

some more ops.



Modified: pypy/dist/pypy/jit/hintmodel.py
==============================================================================
--- pypy/dist/pypy/jit/hintmodel.py	(original)
+++ pypy/dist/pypy/jit/hintmodel.py	Sun Jan 29 11:51:37 2006
@@ -4,9 +4,11 @@
 from pypy.rpython.lltypesystem import lltype
 
 UNARY_OPERATIONS = """same_as hint getfield setfield getsubstruct getarraysize getarrayitem
-                      direct_call""".split()
+                      direct_call
+                      cast_char_to_int""".split()
 
-BINARY_OPERATIONS = "int_add int_sub int_mul int_gt int_lt int_le int_ge int_eq int_ne".split()
+BINARY_OPERATIONS = """int_add int_sub int_mul int_and
+                       int_gt int_lt int_le int_ge int_eq int_ne""".split()
 
 class OriginTreeNode(object):
 
@@ -124,6 +126,11 @@
             return hs_res.reorigin(bookkeeper)
         else:
             return hs_res # impossible value
+
+    def cast_char_to_int(hs_c1):
+        origin = getbookkeeper().myorigin()
+        origin.merge(hs_c1.origins)
+        return SomeLLAbstractConstant(lltype.Signed, {origin: True})
         
 class __extend__(SomeLLAbstractContainer):
 
@@ -161,7 +168,7 @@
         origin.merge(hs_c2.origins)
         return SomeLLAbstractConstant(lltype.Signed, {origin: True})
 
-    int_mul = int_sub = int_add
+    int_and = int_mul = int_sub = int_add
 
     def int_gt((hs_c1, hs_c2)):
         origin = getbookkeeper().myorigin()



More information about the Pypy-commit mailing list