[pypy-commit] pypy ppc-jit-backend: Added GUARD_OVERFLOW instruction.

hager noreply at buildbot.pypy.org
Thu Aug 18 13:46:25 CEST 2011


Author: hager <sven.hager at uni-duesseldorf.de>
Branch: ppc-jit-backend
Changeset: r46599:65e24be1dc8c
Date: 2011-08-18 13:50 +0200
http://bitbucket.org/pypy/pypy/changeset/65e24be1dc8c/

Log:	Added GUARD_OVERFLOW instruction.

diff --git a/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py b/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py
--- a/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py
+++ b/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py
@@ -1171,6 +1171,26 @@
                 reglist.append(cpu.reg_map[failarg])
         cpu.patch_list.append((numops, fail_index, op, reglist))
 
+    def emit_guard_overflow(self, op, cpu):
+        free_reg = cpu.next_free_register
+        self.mfxer(free_reg)
+        self.rlwinm(free_reg, free_reg, 2, 31, 31)
+        self.cmpi(0, 1, free_reg, 0)
+        fail_descr = op.getdescr()
+        fail_index = fail_descr.identifier
+        fail_descr.index = fail_index
+        cpu.saved_descr[fail_index] = fail_descr
+        numops = self.get_number_of_ops()
+        self.beq(0)
+        failargs = op.getfailargs()
+        reglist = []
+        for failarg in failargs:
+            if failarg is None:
+                reglist.append(None)
+            else:
+                reglist.append(cpu.reg_map[failarg])
+        cpu.patch_list.append((numops, fail_index, op, reglist))
+
     def emit_finish(self, op, cpu):
         descr = op.getdescr()
         identifier = self._get_identifier_from_descr(descr, cpu)


More information about the pypy-commit mailing list