[pypy-commit] pypy jit-singlefloat: Missing a case: wrap(longlong).

arigo noreply at buildbot.pypy.org
Fri Jul 29 12:45:23 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: jit-singlefloat
Changeset: r46085:d373caa523ad
Date: 2011-07-29 11:40 +0200
http://bitbucket.org/pypy/pypy/changeset/d373caa523ad/

Log:	Missing a case: wrap(longlong).

diff --git a/pypy/jit/metainterp/test/test_warmstate.py b/pypy/jit/metainterp/test/test_warmstate.py
--- a/pypy/jit/metainterp/test/test_warmstate.py
+++ b/pypy/jit/metainterp/test/test_warmstate.py
@@ -40,6 +40,10 @@
     assert _is(wrap(None, 42, in_const_box=True), ConstInt(42))
     assert _is(wrap(None, 42.5, in_const_box=True), constfloat(42.5))
     assert _is(wrap(None, p, in_const_box=True), ConstPtr(po))
+    if longlong.supports_longlong:
+        import sys
+        value = longlong.r_float_storage(sys.maxint*17)
+        assert _is(wrap(None, value), BoxFloat(value))
 
 def test_hash_equal_whatever_lltype():
     s1 = rstr.mallocstr(2)
diff --git a/pypy/jit/metainterp/warmstate.py b/pypy/jit/metainterp/warmstate.py
--- a/pypy/jit/metainterp/warmstate.py
+++ b/pypy/jit/metainterp/warmstate.py
@@ -84,8 +84,10 @@
             return history.ConstObj(value)
         else:
             return history.BoxObj(value)
-    elif isinstance(value, float):
-        value = longlong.getfloatstorage(value)
+    elif (isinstance(value, float) or
+          longlong.is_longlong(lltype.typeOf(value))):
+        if isinstance(value, float):
+            value = longlong.getfloatstorage(value)
         if in_const_box:
             return history.ConstFloat(value)
         else:


More information about the pypy-commit mailing list