Author: Richard Plangger <[email protected]>
Branch: s390x-enhance-speed
Changeset: r82847:cc0fd9f1b25f
Date: 2016-03-07 15:38 +0100
http://bitbucket.org/pypy/pypy/changeset/cc0fd9f1b25f/
Log: added two more pointer to the literal pool, exchanged some registers
for better pipeline flow
diff --git a/rpython/jit/backend/zarch/assembler.py
b/rpython/jit/backend/zarch/assembler.py
--- a/rpython/jit/backend/zarch/assembler.py
+++ b/rpython/jit/backend/zarch/assembler.py
@@ -1063,8 +1063,8 @@
def _call_footer_shadowstack(self, gcrootmap):
# r6 -> r15 can be used freely, they will be restored by
# _call_footer after this call
- RCS1 = r.r9
- RCS2 = r.r10
+ RCS1 = r.r8
+ RCS2 = r.r7
mc = self.mc
mc.load_imm(RCS1, gcrootmap.get_root_stack_top_addr())
mc.load(RCS2, RCS1, 0) # ld RCS2, [rootstacktop]
@@ -1072,13 +1072,14 @@
mc.store(RCS2, RCS1, 0) # std RCS2, [rootstacktop]
def _call_footer(self):
- # the return value is the jitframe
- self.mc.LGR(r.r2, r.SPP)
gcrootmap = self.cpu.gc_ll_descr.gcrootmap
if gcrootmap and gcrootmap.is_shadow_stack:
self._call_footer_shadowstack(gcrootmap)
+ # the return value is the jitframe
+ self.mc.LGR(r.r2, r.SPP)
+
size = STD_FRAME_SIZE_IN_BYTES
# f8 through f15 are saved registers (= non volatile)
# TODO it would be good to detect if any float is used in the loop
@@ -1248,11 +1249,11 @@
gcmap = self._finish_gcmap
else:
gcmap = lltype.nullptr(jitframe.GCMAP)
- self.load_gcmap(self.mc, r.r2, gcmap)
+ self.load_gcmap(self.mc, r.r9, gcmap)
- self.mc.load_imm(r.r3, fail_descr_loc.getint())
- self.mc.STG(r.r3, l.addr(ofs, r.SPP))
- self.mc.STG(r.r2, l.addr(ofs2, r.SPP))
+ self.mc.load_imm(r.r10, fail_descr_loc.getint())
+ self.mc.STG(r.r9, l.addr(ofs2, r.SPP))
+ self.mc.STG(r.r10, l.addr(ofs, r.SPP))
# exit function
self._call_footer()
diff --git a/rpython/jit/backend/zarch/pool.py
b/rpython/jit/backend/zarch/pool.py
--- a/rpython/jit/backend/zarch/pool.py
+++ b/rpython/jit/backend/zarch/pool.py
@@ -117,9 +117,16 @@
for op in operations:
self.ensure_can_hold_constants(asm, op)
self._ensure_value(asm.cpu.pos_exc_value(), asm)
+ # the top of shadow stack
gcrootmap = asm.cpu.gc_ll_descr.gcrootmap
if gcrootmap and gcrootmap.is_shadow_stack:
- self._ensure_value(gcrootmap.get_root_stack_top_addr())
+ self._ensure_value(gcrootmap.get_root_stack_top_addr(), asm)
+ # endaddr of insert stack check
+ endaddr, lengthaddr, _ = self.cpu.insert_stack_check()
+ self._ensure_value(endaddr, asm)
+ # fast gil
+ fastgil = rgil.gil_fetch_fastgil()
+ self._ensure_value(fastgil, asm)
# TODO add more values that are loaded with load_imm
# XXX def post_assemble(self, asm):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit