[pypy-commit] pypy unsigned-dtypes: put in cast_ulonglong_to_float. Now translates on 32-bit as well.

justinpeel noreply at buildbot.pypy.org
Fri Sep 9 22:45:58 CEST 2011


Author: Justin Peel <notmuchtotell at gmail.com>
Branch: unsigned-dtypes
Changeset: r47191:0a94e1a139da
Date: 2011-09-09 20:45 +0000
http://bitbucket.org/pypy/pypy/changeset/0a94e1a139da/

Log:	put in cast_ulonglong_to_float. Now translates on 32-bit as well.

diff --git a/pypy/jit/codewriter/jtransform.py b/pypy/jit/codewriter/jtransform.py
--- a/pypy/jit/codewriter/jtransform.py
+++ b/pypy/jit/codewriter/jtransform.py
@@ -1004,6 +1004,7 @@
 
     for _op, _oopspec in [('cast_int_to_ulonglong',     'FROM_INT'),
                           ('cast_uint_to_ulonglong',    'FROM_UINT'),
+                          ('cast_ulonglong_to_float',   'TO_FLOAT'),
                          ]:
         exec py.code.Source('''
             def rewrite_op_%s(self, op):
diff --git a/pypy/jit/codewriter/support.py b/pypy/jit/codewriter/support.py
--- a/pypy/jit/codewriter/support.py
+++ b/pypy/jit/codewriter/support.py
@@ -333,6 +333,9 @@
 def _ll_1_llong_to_float(xll):
     return float(rffi.cast(lltype.SignedLongLong, xll))
 
+def _ll_1_ullong_to_float(xull):
+    return float(rffi.cast(lltype.UnsignedLongLong, xull))
+
 
 def _ll_1_llong_abs(xll):
     if xll < 0:


More information about the pypy-commit mailing list