[pypy-svn] r53168 - pypy/branch/jit-hotpath/pypy/jit/codegen/ia32
fijal at codespeak.net
fijal at codespeak.net
Sun Mar 30 23:12:30 CEST 2008
Author: fijal
Date: Sun Mar 30 23:12:29 2008
New Revision: 53168
Modified:
pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py
Log:
support for different consts (still, they don't do anything different)
Modified: pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py (original)
+++ pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py Sun Mar 30 23:12:29 2008
@@ -101,7 +101,7 @@
## revealconst._annspecialcase_ = 'specialize:arg(1)'
-class IntConst(GenConst):
+class Const(GenConst):
def __init__(self, value):
self.value = value
@@ -132,6 +132,14 @@
def repr(self):
return "const=$%s" % (self.value,)
+class IntConst(Const):
+ pass
+
+class FloatConst(Const):
+ pass
+
+class BoolConst(Const):
+ pass
##class FnPtrConst(IntConst):
## def __init__(self, value, mc):
@@ -1077,8 +1085,10 @@
T = lltype.typeOf(llvalue)
if T is llmemory.Address:
return AddrConst(llvalue)
- elif isinstance(T, lltype.Primitive):
- return IntConst(lltype.cast_primitive(lltype.Signed, llvalue))
+ elif T is lltype.Signed:
+ return IntConst(llvalue)
+ elif T is lltype.Bool:
+ return BoolConst(llvalue)
elif isinstance(T, lltype.Ptr):
lladdr = llmemory.cast_ptr_to_adr(llvalue)
if T.TO._gckind == 'gc':
More information about the Pypy-commit
mailing list