Author: Richard Plangger <planri...@gmail.com>
Branch: s390x-backend
Changeset: r81502:afb077bff965
Date: 2015-12-30 16:51 +0100
http://bitbucket.org/pypy/pypy/changeset/afb077bff965/

Log:    save/restore/reset exception is now working as expected by the test,
        overwrote value in a register that was passed to the vm

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
@@ -1088,25 +1088,25 @@
     def _store_and_reset_exception(self, mc, excvalloc, exctploc=None):
         """Reset the exception, after fetching it inside the two regs.
         """
-        mc.load_imm(r.r2, self.cpu.pos_exc_value())
+        mc.load_imm(r.SCRATCH, self.cpu.pos_exc_value())
         diff = self.cpu.pos_exception() - self.cpu.pos_exc_value()
         assert check_imm_value(diff)
         # Load the exception fields into the two registers
-        mc.load(excvalloc, r.r2, 0)
+        mc.load(excvalloc, r.SCRATCH, 0)
         if exctploc is not None:
-            mc.load(exctploc, r.r2, diff)
+            mc.load(exctploc, r.SCRATCH, diff)
         # Zero out the exception fields
-        mc.LGHI(r.r0, l.imm(0))
-        mc.STG(r.r0, l.addr(0, r.r2))
-        mc.STG(r.r0, l.addr(diff, r.r2))
+        mc.LGHI(r.SCRATCH2, l.imm(0))
+        mc.STG(r.SCRATCH2, l.addr(0, r.SCRATCH))
+        mc.STG(r.SCRATCH2, l.addr(diff, r.SCRATCH))
 
     def _restore_exception(self, mc, excvalloc, exctploc):
-        mc.load_imm(r.r2, self.cpu.pos_exc_value())
+        mc.load_imm(r.SCRATCH, self.cpu.pos_exc_value())
         diff = self.cpu.pos_exception() - self.cpu.pos_exc_value()
         assert check_imm_value(diff)
         # Store the exception fields from the two registers
-        mc.STG(excvalloc, l.addr(0, r.r2))
-        mc.STG(exctploc, l.addr(diff, r.r2))
+        mc.STG(excvalloc, l.addr(0, r.SCRATCH))
+        mc.STG(exctploc, l.addr(diff, r.SCRATCH))
 
     def load_gcmap(self, mc, reg, gcmap):
         # load the current gcmap into register 'reg'
diff --git a/rpython/jit/backend/zarch/opassembler.py 
b/rpython/jit/backend/zarch/opassembler.py
--- a/rpython/jit/backend/zarch/opassembler.py
+++ b/rpython/jit/backend/zarch/opassembler.py
@@ -751,8 +751,8 @@
 
     def emit_save_exc_class(self, op, arglocs, regalloc):
         [resloc] = arglocs
-        diff = self.mc.load_imm_plus(r.r2, self.cpu.pos_exception())
-        self.mc.load(resloc, r.r2, diff)
+        diff = self.mc.load_imm_plus(r.SCRATCH, self.cpu.pos_exception())
+        self.mc.load(resloc, r.SCRATCH, diff)
 
     def emit_save_exception(self, op, arglocs, regalloc):
         [resloc] = arglocs
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to