[pypy-commit] pypy ppc-backend-2: Add float support to emit_guard_value and emit_guard_call_assembler.

edelsohn noreply at buildbot.pypy.org
Tue Apr 24 04:47:46 CEST 2012


Author: edelsohn
Branch: ppc-backend-2
Changeset: r54712:9d75068f7a11
Date: 2012-04-23 22:45 -0400
http://bitbucket.org/pypy/pypy/changeset/9d75068f7a11/

Log:	Add float support to emit_guard_value and emit_guard_call_assembler.

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
@@ -282,8 +282,9 @@
                 self.mc.cmp_op(0, l0.value, l1.getint(), imm=True)
             else:
                 self.mc.cmp_op(0, l0.value, l1.value)
-        else:
-            assert 0, "not implemented yet"
+        elif l0.is_fp_reg():
+            assert l1.is_fp_reg()
+            self.mc.cmp_op(0, l0,value, l1.value)
         self._emit_guard(op, failargs, c.NE)
 
     emit_guard_nonnull = emit_guard_true
@@ -1179,13 +1180,13 @@
             elif kind == REF:
                 adr = self.fail_boxes_ptr.get_addr_for_num(0)
             elif kind == FLOAT:
-                assert 0, "not implemented"
+                adr = self.fail_boxes_float.get_addr_for_num(0)
             else:
                 raise AssertionError(kind)
             with scratch_reg(self.mc):
                 self.mc.load_imm(r.SCRATCH, adr)
                 if op.result.type == FLOAT:
-                    assert 0, "not implemented yet"
+                    self.mc.lfdx(resloc.value, 0, r.SCRATCH.value)
                 else:
                     self.mc.loadx(resloc.value, 0, r.SCRATCH.value)
 
@@ -1201,13 +1202,15 @@
         # Path B: use assembler helper
         asm_helper_adr = self.cpu.cast_adr_to_int(jd.assembler_helper_adr)
         if self.cpu.supports_floats:
-            assert 0, "not implemented yet"
+            floats = r.VOLATILES_FLOAT
+        else:
+            floats = []
 
         with Saved_Volatiles(self.mc, save_RES=False):
             # result of previous call is in r3
             self.mov_loc_loc(arglocs[0], r.r4)
             self.mc.call(asm_helper_adr)
-            if op.result and resloc.is_vfp_reg():
+            if op.result and resloc.is_fp_reg():
                 assert 0, "not implemented yet"
 
         # merge point


More information about the pypy-commit mailing list