[pypy-commit] pypy ppc-jit-backend: Add support for convert_float_bytes_to_longlong and
edelsohn
noreply at buildbot.pypy.org
Tue Jun 12 16:46:38 CEST 2012
Author: edelsohn
Branch: ppc-jit-backend
Changeset: r55618:635cf13e082a
Date: 2012-06-12 10:46 -0400
http://bitbucket.org/pypy/pypy/changeset/635cf13e082a/
Log: Add support for convert_float_bytes_to_longlong and
convert_longlong_bytes_to_float.
diff --git a/pypy/jit/backend/ppc/opassembler.py b/pypy/jit/backend/ppc/opassembler.py
--- a/pypy/jit/backend/ppc/opassembler.py
+++ b/pypy/jit/backend/ppc/opassembler.py
@@ -223,6 +223,16 @@
self.mc.lfd(temp_loc.value, r.SPP.value, FORCE_INDEX_OFS + WORD)
self.mc.fcfid(res.value, temp_loc.value)
+ def emit_convert_float_bytes_to_longlong(self, op, arglocs, regalloc):
+ l0, res = arglocs
+ self.mc.stfd(l0.value, r.SPP.value, FORCE_INDEX_OFS + WORD)
+ self.mc.ld(res.value, r.SPP.value, FORCE_INDEX_OFS + WORD)
+
+ def emit_convert_longlong_bytes_to_float(self, op, arglocs, regalloc):
+ l0, res = arglocs
+ self.mc.std(l0.value, r.SPP.value, FORCE_INDEX_OFS + WORD)
+ self.mc.lfd(res.value, r.SPP.value, FORCE_INDEX_OFS + WORD)
+
class GuardOpAssembler(object):
_mixin_ = True
diff --git a/pypy/jit/backend/ppc/regalloc.py b/pypy/jit/backend/ppc/regalloc.py
--- a/pypy/jit/backend/ppc/regalloc.py
+++ b/pypy/jit/backend/ppc/regalloc.py
@@ -508,6 +508,20 @@
res = self.fprm.force_allocate_reg(op.result)
return [loc1, temp_loc, res]
+ def prepare_convert_float_bytes_to_longlong(self, op):
+ loc1 = self._ensure_value_is_boxed(op.getarg(0))
+ self.possibly_free_vars_for_op(op)
+ self.free_temp_vars()
+ res = self.rm.force_allocate_reg(op.result)
+ return [loc1, res]
+
+ def prepare_convert_longlong_bytes_to_float(self, op):
+ loc1 = self._ensure_value_is_boxed(op.getarg(0))
+ self.possibly_free_vars_for_op(op)
+ self.free_temp_vars()
+ res = self.fprm.force_allocate_reg(op.result)
+ return [loc1, res]
+
def prepare_finish(self, op):
args = [None] * (op.numargs() + 1)
for i in range(op.numargs()):
More information about the pypy-commit
mailing list