[pypy-commit] pypy ppc-jit-backend: setarrayitem and getarrayitem offsets are immediate values.

edelsohn noreply at buildbot.pypy.org
Mon Nov 14 20:27:26 CET 2011


Author: edelsohn
Branch: ppc-jit-backend
Changeset: r49414:3a6600bf032a
Date: 2011-11-14 14:27 -0500
http://bitbucket.org/pypy/pypy/changeset/3a6600bf032a/

Log:	setarrayitem and getarrayitem offsets are immediate values.

diff --git a/pypy/jit/backend/ppc/ppcgen/opassembler.py b/pypy/jit/backend/ppc/ppcgen/opassembler.py
--- a/pypy/jit/backend/ppc/ppcgen/opassembler.py
+++ b/pypy/jit/backend/ppc/ppcgen/opassembler.py
@@ -367,11 +367,10 @@
         value_loc, base_loc, ofs_loc, scale, ofs = arglocs
         if scale.value > 0:
             scale_loc = r.r0
-            self.mc.load_imm(r.r0, scale.value)
             if IS_PPC_32:
-                self.mc.slw(r.r0.value, ofs_loc.value, r.r0.value)
+                self.mc.slwi(r.r0.value, ofs_loc.value, scale.value)
             else:
-                self.mc.sld(r.r0.value, ofs_loc.value, r.r0.value)
+                self.mc.sldi(r.r0.value, ofs_loc.value, scale.value)
         else:
             scale_loc = ofs_loc
 
@@ -396,11 +395,10 @@
         res, base_loc, ofs_loc, scale, ofs = arglocs
         if scale.value > 0:
             scale_loc = r.r0
-            self.mc.load_imm(r.r0, scale.value)
             if IS_PPC_32:
-                self.mc.slw(r.r0.value, ofs_loc.value, scale.value)
+                self.mc.slwi(r.r0.value, ofs_loc.value, scale.value)
             else:
-                self.mc.sld(r.r0.value, ofs_loc.value, scale.value)
+                self.mc.sldi(r.r0.value, ofs_loc.value, scale.value)
         else:
             scale_loc = ofs_loc
         if ofs.value > 0:


More information about the pypy-commit mailing list