[pypy-commit] pypy ppc-jit-backend: allocate and deallocate SCRATCH in store_reg.

edelsohn noreply at buildbot.pypy.org
Fri Dec 30 18:22:15 CET 2011


Author: edelsohn
Branch: ppc-jit-backend
Changeset: r50966:03c64ec12500
Date: 2011-12-30 12:16 -0500
http://bitbucket.org/pypy/pypy/changeset/03c64ec12500/

Log:	allocate and deallocate SCRATCH in store_reg. refer to r.SCRATCH in
	b_abs and bl_abs.

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
@@ -990,11 +990,12 @@
             self.ldx(rD.value, 0, rD.value)
 
     def store_reg(self, source_reg, addr):
-        self.load_imm(r.r0, addr)
+        self.alloc_scratch_reg(addr)
         if IS_PPC_32:
-            self.stwx(source_reg.value, 0, r.r0.value)
+            self.stwx(source_reg.value, 0, r.SCRATCH.value)
         else:
-            self.stdx(source_reg.value, 0, r.r0.value)
+            self.stdx(source_reg.value, 0, r.SCRATCH.value)
+        self.free_scratch_reg()
 
     def b_offset(self, offset):
         curpos = self.currpos()
@@ -1021,7 +1022,7 @@
 
     def b_abs(self, address, trap=False):
         self.alloc_scratch_reg(address)
-        self.mtctr(r.r0.value)
+        self.mtctr(r.SCRATCH.value)
         self.free_scratch_reg()
         if trap:
             self.trap()
@@ -1029,7 +1030,7 @@
 
     def bl_abs(self, address):
         self.alloc_scratch_reg(address)
-        self.mtctr(r.r0.value)
+        self.mtctr(r.SCRATCH.value)
         self.free_scratch_reg()
         self.bctrl()
 


More information about the pypy-commit mailing list