[pypy-commit] pypy ppc-jit-backend: setarrayitem and getarrayitem cannot add offset with addi.

edelsohn noreply at buildbot.pypy.org
Mon Nov 14 20:35:24 CET 2011


Author: edelsohn
Branch: ppc-jit-backend
Changeset: r49415:b6a18d1530bf
Date: 2011-11-14 14:35 -0500
http://bitbucket.org/pypy/pypy/changeset/b6a18d1530bf/

Log:	setarrayitem and getarrayitem cannot add offset with addi.

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
@@ -374,8 +374,10 @@
         else:
             scale_loc = ofs_loc
 
+        # add the base offset
         if ofs.value > 0:
-            self.mc.addi(r.r0.value, scale_loc.value, ofs.value)
+            #XXX cannot use addi because scale_loc may be r0
+            self.mc.addic(r.r0.value, scale_loc.value, ofs.value)
             scale_loc = r.r0
 
         if scale.value == 3:
@@ -401,8 +403,11 @@
                 self.mc.sldi(r.r0.value, ofs_loc.value, scale.value)
         else:
             scale_loc = ofs_loc
+
+        # add the base offset
         if ofs.value > 0:
-            self.mc.addi(r.r0.value, scale_loc.value, ofs.value)
+            #XXX cannot use addi because scale_loc may be r0
+            self.mc.addic(r.r0.value, scale_loc.value, ofs.value)
             scale_loc = r.r0
 
         if scale.value == 3:


More information about the pypy-commit mailing list