[pypy-commit] pypy ppc-jit-backend: (bivab, hager): Make first tests on PPC64 pass

hager noreply at buildbot.pypy.org
Fri Nov 11 14:26:51 CET 2011


Author: hager <sven.hager at uni-duesseldorf.de>
Branch: ppc-jit-backend
Changeset: r49305:e1cc85b1017d
Date: 2011-11-11 05:26 -0800
http://bitbucket.org/pypy/pypy/changeset/e1cc85b1017d/

Log:	(bivab, hager): Make first tests on PPC64 pass

diff --git a/pypy/jit/backend/ppc/ppcgen/helper/assembler.py b/pypy/jit/backend/ppc/ppcgen/helper/assembler.py
--- a/pypy/jit/backend/ppc/ppcgen/helper/assembler.py
+++ b/pypy/jit/backend/ppc/ppcgen/helper/assembler.py
@@ -94,6 +94,12 @@
             | ord(mem[index+1]) << 16
             | ord(mem[index]) << 24)
 
+def decode64(mem, index):
+    high = decode32(mem, index)
+    index += 4
+    low = decode32(mem, index)
+    return (r_longlong(high) << 32) | r_longlong(r_uint(low))
+
 def count_reg_args(args):
     reg_args = 0
     words = 0
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
@@ -12,7 +12,8 @@
                                               NONVOLATILES,
                                               GPR_SAVE_AREA, BACKCHAIN_SIZE)
 from pypy.jit.backend.ppc.ppcgen.helper.assembler import (gen_emit_cmp_op, 
-                                                          encode32, decode32)
+                                                          encode32, decode32,
+                                                          decode64)
 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,
@@ -271,7 +272,10 @@
                     self.fail_boxes_float.setitem(fail_index, value)
                     continue
                 else:
-                    value = decode32(regs, (reg - 3) * WORD)
+                    if IS_PPC_32:
+                        value = decode32(regs, (reg - 3) * WORD)
+                    else:
+                        value = decode64(regs, (reg - 3) * WORD)
     
             if group == self.INT_TYPE:
                 self.fail_boxes_int.setitem(fail_index, value)


More information about the pypy-commit mailing list