[pypy-commit] pypy float-bytes-2: Now works on 32-bit. test_zll_stress doesn't work though.
alex_gaynor
noreply at buildbot.pypy.org
Tue Mar 27 00:51:52 CEST 2012
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: float-bytes-2
Changeset: r54014:cb37f9de4640
Date: 2012-03-26 22:50 +0000
http://bitbucket.org/pypy/pypy/changeset/cb37f9de4640/
Log: Now works on 32-bit. test_zll_stress doesn't work though.
diff --git a/pypy/jit/backend/x86/assembler.py b/pypy/jit/backend/x86/assembler.py
--- a/pypy/jit/backend/x86/assembler.py
+++ b/pypy/jit/backend/x86/assembler.py
@@ -1258,7 +1258,7 @@
assert isinstance(loc0, RegLoc)
self.mc.MOVD(resloc, loc0)
else:
- raise
+ self.mov(loc0, resloc)
def genop_guard_int_is_true(self, op, guard_op, guard_token, arglocs, resloc):
guard_opnum = guard_op.getopnum()
diff --git a/pypy/jit/backend/x86/regalloc.py b/pypy/jit/backend/x86/regalloc.py
--- a/pypy/jit/backend/x86/regalloc.py
+++ b/pypy/jit/backend/x86/regalloc.py
@@ -785,7 +785,10 @@
self.Perform(op, [loc0], loc1)
self.rm.possibly_free_var(op.getarg(0))
else:
- raise
+ loc0 = self.xrm.make_sure_var_in_reg(op.getarg(0))
+ loc1 = self.xrm.force_allocate_reg(op.result)
+ self.Perform(op, [loc0], loc1)
+ self.xrm.possibly_free_var(op.getarg(0))
def _consider_llong_binop_xx(self, op):
# must force both arguments into xmm registers, because we don't
diff --git a/pypy/jit/metainterp/blackhole.py b/pypy/jit/metainterp/blackhole.py
--- a/pypy/jit/metainterp/blackhole.py
+++ b/pypy/jit/metainterp/blackhole.py
@@ -674,7 +674,8 @@
@arguments(LONGLONG_TYPECODE, returns="f")
def bhimpl_convert_longlong_bytes_to_float(a):
- return longlong2float.longlong2float(a)
+ a = longlong2float.longlong2float(a)
+ return longlong.getfloatstorage(a)
# ----------
# control flow operations
diff --git a/pypy/jit/metainterp/test/test_ajit.py b/pypy/jit/metainterp/test/test_ajit.py
--- a/pypy/jit/metainterp/test/test_ajit.py
+++ b/pypy/jit/metainterp/test/test_ajit.py
@@ -3796,25 +3796,17 @@
res = self.interp_operations(g, [1])
assert res == 3
- def test_float2longlong(self):
+ def test_float_bytes(self):
def f(n):
- return float2longlong(n)
+ ll = float2longlong(n)
+ return longlong2float(ll)
for x in [2.5, float("nan"), -2.5, float("inf")]:
# There are tests elsewhere to verify the correctness of this.
- expected = float2longlong(x)
res = self.interp_operations(f, [x])
- assert longlong.getfloatstorage(res) == expected
-
- def test_longlong2float(self):
- def f(n):
- return longlong2float(n)
-
- for x in [2.5, float("nan"), -2.5, float("inf")]:
- longval = float2longlong(x)
- res = self.interp_operations(f, [longval])
assert res == x or math.isnan(x) and math.isnan(res)
+
class TestLLtype(BaseLLtypeTests, LLJitMixin):
def test_tagged(self):
from pypy.rlib.objectmodel import UnboxedValue
More information about the pypy-commit
mailing list