[pypy-commit] pypy ppc-jit-backend: Add PPC64 support to emit_setfield_gc and emit_getfield_gc.

edelsohn noreply at buildbot.pypy.org
Mon Oct 24 17:27:48 CEST 2011


Author: edelsohn
Branch: ppc-jit-backend
Changeset: r48377:90737207852a
Date: 2011-10-24 11:26 -0400
http://bitbucket.org/pypy/pypy/changeset/90737207852a/

Log:	Add PPC64 support to emit_setfield_gc and emit_getfield_gc. Correct
	typo in emit_setfield_gc for size == 4.

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
@@ -261,12 +261,15 @@
     def emit_setfield_gc(self, op, arglocs, regalloc):
         value_loc, base_loc, ofs, size = arglocs
         if size.value == 8:
-            assert 0, "not implemented yet"
+            if ofs.is_imm():
+                self.mc.std(value_loc.value, base_loc.value, ofs.value)
+            else:
+                self.mc.stdx(value_loc.value, base_loc.value, ofs.value)
         elif size.value == 4:
             if ofs.is_imm():
                 self.mc.stw(value_loc.value, base_loc.value, ofs.value)
             else:
-                self.mc.stw(value_loc.value, base_loc.value, ofs.value)
+                self.mc.stwx(value_loc.value, base_loc.value, ofs.value)
         elif size.value == 2:
             if ofs.is_imm():
                 self.mc.sth(value_loc.value, base_loc.value, ofs.value)
@@ -284,7 +287,10 @@
     def emit_getfield_gc(self, op, arglocs, regalloc):
         base_loc, ofs, res, size = arglocs
         if size.value == 8:
-            assert 0, "not implemented yet"
+            if ofs.is_imm():
+                self.mc.ld(res.value, base_loc.value, ofs.value)
+            else:
+                self.mc.ldx(res.value, base_loc.value, ofs.value)
         elif size.value == 4:
             if ofs.is_imm():
                 self.mc.lwz(res.value, base_loc.value, ofs.value)


More information about the pypy-commit mailing list