[pypy-commit] pypy ppc-jit-backend: merge

hager noreply at buildbot.pypy.org
Tue Nov 29 10:45:44 CET 2011


Author: hager <sven.hager at uni-duesseldorf.de>
Branch: ppc-jit-backend
Changeset: r49948:5e00ef86a581
Date: 2011-11-29 10:45 +0100
http://bitbucket.org/pypy/pypy/changeset/5e00ef86a581/

Log:	merge

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
@@ -295,8 +295,7 @@
         descr = op.getdescr()
         assert isinstance(descr, LoopToken)
         if descr._ppc_bootstrap_code == 0:
-            curpos = self.mc.get_rel_pos()
-            self.mc.b(descr._ppc_loop_code - curpos)
+            self.mc.b_offset(descr._ppc_loop_code)
         else:
             target = descr._ppc_bootstrap_code + descr._ppc_loop_code
             self.mc.b_abs(target)
diff --git a/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py b/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py
--- a/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py
+++ b/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py
@@ -270,10 +270,7 @@
                 if group == self.FLOAT_TYPE:
                     assert 0, "not implemented yet"
                 else:
-		    if IS_PPC_32:
-                        value = decode32(spilling_area, spilling_depth - stack_location * WORD)
-		    else:
-                        value = decode64(spilling_area, spilling_depth - stack_location * WORD)
+                    value = decode32(spilling_area, spilling_depth - stack_location * WORD)
             else: # REG_LOC
                 reg = ord(enc[i])
                 if group == self.FLOAT_TYPE:
@@ -281,10 +278,12 @@
                     self.fail_boxes_float.setitem(fail_index, value)
                     continue
                 else:
+                    # XXX dirty, fix
+                    sub = r.managed_regs_sub(reg)
                     if IS_PPC_32:
-                        value = decode32(regs, (reg - 3) * WORD)
+                        value = decode32(regs, (reg - sub) * WORD)
                     else:
-                        value = decode64(regs, (reg - 3) * WORD)
+                        value = decode64(regs, (reg - sub) * WORD)
     
             if group == self.INT_TYPE:
                 self.fail_boxes_int.setitem(fail_index, value)
@@ -325,8 +324,10 @@
                 loc = regalloc.frame_manager.frame_pos(stack_loc, INT)
                 j += 4
             else: # REG_LOC
-                #loc = r.all_regs[ord(res)]
-                loc = r.MANAGED_REGS[ord(res) - 3]
+                reg = ord(res)
+                # XXX dirty, fix
+                sub = r.managed_regs_sub(reg)
+                loc = r.MANAGED_REGS[reg - sub]
             j += 1
             locs.append(loc)
         return locs
diff --git a/pypy/jit/backend/ppc/ppcgen/register.py b/pypy/jit/backend/ppc/ppcgen/register.py
--- a/pypy/jit/backend/ppc/ppcgen/register.py
+++ b/pypy/jit/backend/ppc/ppcgen/register.py
@@ -16,8 +16,14 @@
 RES = r3
 
 MANAGED_REGS = [r3, r4, r5, r6, r7, r8, r9, r10,
-                r11, r12, r13, r14, r15, r16, r17, r18, 
+                r11, r12, r14, r15, r16, r17, r18, 
                 r19, r20, r21, r22, r23, r24, r25, r26,
                 r27, r28, r29, r30]
 
 PARAM_REGS = [r3, r4, r5, r6, r7, r8, r9, r10]
+
+# XXX fix this at some point
+def managed_regs_sub(reg):
+    if reg > r13.value:
+        return 4
+    return 3


More information about the pypy-commit mailing list