Author: Alex Gaynor <alex.gay...@gmail.com> Branch: float-bytes Changeset: r53695:5b02bd39e20b Date: 2012-03-15 12:00 -0700 http://bitbucket.org/pypy/pypy/changeset/5b02bd39e20b/
Log: (arigo, alex): randomized tests, and fix to regalloc diff --git a/pypy/jit/backend/test/test_random.py b/pypy/jit/backend/test/test_random.py --- a/pypy/jit/backend/test/test_random.py +++ b/pypy/jit/backend/test/test_random.py @@ -449,6 +449,7 @@ OPERATIONS.append(CastFloatToIntOperation(rop.CAST_FLOAT_TO_INT)) OPERATIONS.append(CastIntToFloatOperation(rop.CAST_INT_TO_FLOAT)) +OPERATIONS.append(CastFloatToIntOperation(rop.CONVERT_FLOAT_BYTES_TO_LONGLONG)) OperationBuilder.OPERATIONS = OPERATIONS @@ -502,11 +503,11 @@ else: assert 0, "unknown backend %r" % pytest.config.option.backend -# ____________________________________________________________ +# ____________________________________________________________ class RandomLoop(object): dont_generate_more = False - + def __init__(self, cpu, builder_factory, r, startvars=None): self.cpu = cpu if startvars is None: 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 @@ -1245,6 +1245,7 @@ def genop_convert_float_bytes_to_longlong(self, op, arglocs, resloc): loc0, = arglocs assert isinstance(resloc, RegLoc) + assert isinstance(loc0, RegLoc) self.mc.MOVD(resloc, loc0) def genop_guard_int_is_true(self, op, guard_op, guard_token, arglocs, resloc): 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 @@ -767,7 +767,7 @@ consider_cast_singlefloat_to_float = consider_cast_int_to_float def consider_convert_float_bytes_to_longlong(self, op): - loc0 = self.xrm.loc(op.getarg(0)) + loc0 = self.xrm.make_sure_var_in_reg(op.getarg(0)) loc1 = self.rm.force_allocate_reg(op.result) self.Perform(op, [loc0], loc1) self.xrm.possibly_free_var(op.getarg(0)) diff --git a/pypy/jit/backend/x86/rx86.py b/pypy/jit/backend/x86/rx86.py --- a/pypy/jit/backend/x86/rx86.py +++ b/pypy/jit/backend/x86/rx86.py @@ -601,6 +601,7 @@ CVTSS2SD_xb = xmminsn('\xF3', rex_nw, '\x0F\x5A', register(1, 8), stack_bp(2)) + # These work on machine sized registers. MOVD_rx = xmminsn('\x66', rex_w, '\x0F\x7E', register(2, 8), register(1), '\xC0') MOVD_xr = xmminsn('\x66', rex_w, '\x0F\x6E', register(1, 8), register(2), '\xC0') MOVD_xb = xmminsn('\x66', rex_w, '\x0F\x6E', register(1, 8), stack_bp(2)) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit