1. Dan Colish
  2. pypy

Commits

Sven Hager  committed 0dbe153 Merge

merge

  • Participants
  • Parent commits a82d973, 21ca802
  • Branches ppc-jit-backend

Comments (0)

Files changed (2)

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

View file
  • Ignore whitespace
         if scale.value > 0:
             scale_loc = r.r0
             self.mc.load_imm(r.r0, scale.value)
-            self.mc.slw(r.r0.value, ofs_loc.value, r.r0.value)
+            if IS_PPC_32:
+                self.mc.slw(r.r0.value, ofs_loc.value, r.r0.value)
+            else:
+                self.mc.sld(r.r0.value, ofs_loc.value, r.r0.value)
         else:
             scale_loc = ofs_loc
 
         if scale.value > 0:
             scale_loc = r.r0
             self.mc.load_imm(r.r0, scale.value)
-            self.mc.slw(r.r0.value, ofs_loc.value, scale.value)
+            if IS_PPC_32:
+                self.mc.slw(r.r0.value, ofs_loc.value, scale.value)
+            else:
+                self.mc.sld(r.r0.value, ofs_loc.value, scale.value)
         else:
             scale_loc = ofs_loc
         if ofs.value > 0:
     def emit_unicodegetitem(self, op, arglocs, regalloc):
         res, base_loc, ofs_loc, scale, basesize, itemsize = arglocs
 
-        self.mc.slwi(ofs_loc.value, ofs_loc.value, scale.value)
+        if IS_PPC_32:
+            self.mc.slwi(ofs_loc.value, ofs_loc.value, scale.value)
+        else:
+            self.mc.sldi(ofs_loc.value, ofs_loc.value, scale.value)
         self.mc.add(res.value, base_loc.value, ofs_loc.value)
 
         if scale.value == 2:
     def emit_unicodesetitem(self, op, arglocs, regalloc):
         value_loc, base_loc, ofs_loc, scale, basesize, itemsize = arglocs
 
-        self.mc.slwi(ofs_loc.value, ofs_loc.value, scale.value)
+        if IS_PPC_32:
+            self.mc.slwi(ofs_loc.value, ofs_loc.value, scale.value)
+        else:
+            self.mc.sldi(ofs_loc.value, ofs_loc.value, scale.value)
         self.mc.add(base_loc.value, base_loc.value, ofs_loc.value)
 
         if scale.value == 2:
         remap_frame_layout(self, non_float_locs, non_float_regs, r.r0)
 
         #the actual call
-        self.mc.bl_abs(adr)
+        if IS_PPC_32:
+            self.mc.bl_abs(adr)
+        else:
+            self.mc.std(r.r2.value, r.SP.value, 40)
+            self.mc.load_from_addr(r.r0, adr)
+            self.mc.load_from_addr(r.r2, adr+WORD)
+            self.mc.load_from_addr(r.r11, adr+2*WORD)
+            self.mc.mtctr(r.r0.value)
+            self.mc.bctrl()
+            self.mc.ld(r.r2.value, r.SP.value, 40)
+
         self.mark_gc_roots(force_index)
         regalloc.possibly_free_vars(args)
         # readjust the sp in case we passed some args on the stack

File pypy/jit/backend/ppc/ppcgen/ppc_assembler.py

View file
  • Ignore whitespace
 from pypy.jit.backend.ppc.ppcgen.arch import (IS_PPC_32, WORD, NONVOLATILES,
                                               GPR_SAVE_AREA, BACKCHAIN_SIZE)
 from pypy.jit.backend.ppc.ppcgen.helper.assembler import (gen_emit_cmp_op, 
-                                                          encode32, decode32, decode32_test)
+                                                          encode32, decode32)
 import pypy.jit.backend.ppc.ppcgen.register as r
 import pypy.jit.backend.ppc.ppcgen.condition as c
 from pypy.jit.metainterp.history import (Const, ConstPtr, LoopToken,