[pypy-svn] r22825 - pypy/dist/pypy/jit
pedronis at codespeak.net
pedronis at codespeak.net
Sun Jan 29 12:41:12 CET 2006
Author: pedronis
Date: Sun Jan 29 12:41:11 2006
New Revision: 22825
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 12:41:11 2006
@@ -7,6 +7,7 @@
cast_pointer
direct_call
int_is_true int_neg
+ cast_int_to_uint
cast_char_to_int
cast_bool_to_int""".split()
@@ -141,8 +142,17 @@
origin = getbookkeeper().myorigin()
origin.merge(hs_c1.origins)
return SomeLLAbstractConstant(lltype.Bool, {origin: True})
+
+class __extend__(SomeLLConcreteValue):
+
+ def cast_int_to_uint(hs_cv1):
+ return SomeLLConcreteValue(lltype.Unsigned)
+
+ def int_neg(hs_cv1):
+ return SomeLLConcreteValue(lltype.Signed)
+
+ cast_bool_to_int = cast_char_to_int = int_neg
-
class __extend__(SomeLLAbstractContainer):
def setfield(hs_s1, hs_fieldname, hs_value):
@@ -168,6 +178,9 @@
res_vstruct =hs_s1.contentdef.cast(TO)
return SomeLLAbstractContainer(res_vstruct)
+# ____________________________________________________________
+# binary
+
class __extend__(pairtype(SomeLLAbstractValue, SomeLLAbstractValue)):
def int_add((hs_v1, hs_v2)):
@@ -193,13 +206,13 @@
int_floordiv = int_rshift = int_and = int_mul = int_sub = int_add
- def int_gt((hs_c1, hs_c2)):
+ def int_eq((hs_c1, hs_c2)):
origin = getbookkeeper().myorigin()
origin.merge(hs_c1.origins)
origin.merge(hs_c2.origins)
return SomeLLAbstractConstant(lltype.Bool, {origin: True})
- int_lt = int_le = int_ge = int_eq = int_ne = int_gt
+ int_lt = int_le = int_ge = int_ne = int_gt = int_eq
def union((hs_c1, hs_c2)):
assert hs_c1.concretetype == hs_c2.concretetype
@@ -213,9 +226,13 @@
def int_add((hs_c1, hs_c2)):
return SomeLLConcreteValue(lltype.Signed)
+ int_floordiv = int_rshift = int_and = int_mul = int_sub = int_add
+
def int_eq((hs_c1, hs_c2)):
return SomeLLConcreteValue(lltype.Bool)
+ int_lt = int_le = int_ge = int_ne = int_gt = int_eq
+
class __extend__(pairtype(SomeLLAbstractContainer, SomeLLAbstractContainer)):
def union((hs_cont1, hs_cont2)):
More information about the Pypy-commit
mailing list