[pypy-commit] pypy ppc-jit-backend: Added a few helper methods.

hager noreply at buildbot.pypy.org
Wed Oct 12 14:59:11 CEST 2011


Author: hager <sven.hager at uni-duesseldorf.de>
Branch: ppc-jit-backend
Changeset: r47962:546e04f68771
Date: 2011-10-12 14:50 +0200
http://bitbucket.org/pypy/pypy/changeset/546e04f68771/

Log:	Added a few helper methods.

diff --git a/pypy/jit/backend/ppc/ppcgen/codebuilder.py b/pypy/jit/backend/ppc/ppcgen/codebuilder.py
--- a/pypy/jit/backend/ppc/ppcgen/codebuilder.py
+++ b/pypy/jit/backend/ppc/ppcgen/codebuilder.py
@@ -964,8 +964,20 @@
         else:
             self.std(source_reg.value, 0, 0)
 
-    def prepare_insts_blocks(self):
-        self.assemble(True)
+    def b_cond_offset(self, offset, condition):
+        pos = self.currpos()
+        target_ofs = offset - pos
+        #self.trap()
+        #import pdb; pdb.set_trace()
+        self.bc(condition, 0, target_ofs)
+
+    def b_abs(self, address):
+        self.load_imm(r.r0, address)
+        self.mtctr(0)
+        self.bctr()
+
+    def prepare_insts_blocks(self, show=False):
+        self.assemble(show)
         insts = self.insts
         for inst in insts:
             self.write32(inst.assemble())
@@ -990,6 +1002,9 @@
     def currpos(self):
         return self.get_rel_pos()
 
+    def copy_to_raw_memory(self, addr):
+        self._copy_to_raw_memory(addr)
+
 class BranchUpdater(PPCAssembler):
     def __init__(self):
         PPCAssembler.__init__(self)


More information about the pypy-commit mailing list