Commits

Anonymous committed d4c1290

More PPC64 support for arraylen_gc, setarrayitem_gc, getarrayitem_gc

Comments (0)

Files changed (1)

pypy/jit/backend/ppc/ppcgen/opassembler.py

         offset = locs[2]
         if offset is not None:
             if offset.is_imm():
-                self.mc.lwz(r.r0.value, locs[0].value, offset.value)
+                if IS_PPC_32:
+                    self.mc.lwz(r.r0.value, locs[0].value, offset.value)
+                else:
+                    self.mc.ld(r.r0.value, locs[0].value, offset.value)
             else:
-                self.mc.lwzx(r.r0.value, locs[0].value, offset.value)
+                if IS_PPC_32:
+                    self.mc.lwzx(r.r0.value, locs[0].value, offset.value)
+                else:
+                    self.mc.ldx(r.r0.value, locs[0].value, offset.value)
             self.mc.cmp(r.r0.value, locs[1].value)
         else:
             assert 0, "not implemented yet"
     # XXX 64 bit adjustment
     def emit_arraylen_gc(self, op, arglocs, regalloc):
         res, base_loc, ofs = arglocs
-        self.mc.lwz(res.value, base_loc.value, ofs.value)
+        if IS_PPC_32:
+            self.mc.lwz(res.value, base_loc.value, ofs.value)
+        else:
+            self.mc.ld(res.value, base_loc.value, ofs.value)
 
     # XXX 64 bit adjustment
     def emit_setarrayitem_gc(self, op, arglocs, regalloc):
             scale_loc = r.r0
 
         if scale.value == 3:
-            assert 0, "not implemented yet"
+            self.mc.stdx(value_loc.value, base_loc.value, scale_loc.value)
         elif scale.value == 2:
             self.mc.stwx(value_loc.value, base_loc.value, scale_loc.value)
         elif scale.value == 1:
             scale_loc = r.r0
 
         if scale.value == 3:
-            assert 0, "not implemented yet"
+            self.mc.ldx(res.value, base_loc.value, scale_loc.value)
         elif scale.value == 2:
             self.mc.lwzx(res.value, base_loc.value, scale_loc.value)
         elif scale.value == 1:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.