Author: Richard Plangger <planri...@gmail.com>
Branch: s390x-backend
Changeset: r82277:b41c97d15afd
Date: 2016-02-16 11:38 +0100
http://bitbucket.org/pypy/pypy/changeset/b41c97d15afd/

Log:    stacklet switch command s390x was broken due to saving of f8-f15,
        storing them into the standard frame in unused slots instead

diff --git a/rpython/translator/c/src/stacklet/switch_s390x_gcc.h 
b/rpython/translator/c/src/stacklet/switch_s390x_gcc.h
--- a/rpython/translator/c/src/stacklet/switch_s390x_gcc.h
+++ b/rpython/translator/c/src/stacklet/switch_s390x_gcc.h
@@ -10,22 +10,18 @@
      /* The Stackless version by Kristjan Valur Jonsson,
         ported to s390x by Richard Plangger */
 
-     "lay 15,-64(15)\n"           /* additional stack space to store f8-f15 */
      "stmg 6,15,48(15)\n"
 
-     "std 0,128(15)\n"
-     "std 2,136(15)\n"
-     "std 4,144(15)\n"
-     "std 6,152(15)\n"
+     // store f8 - f15 into the stack frame that is not used!
+     "std 8,128(15)\n"
+     "std 9,136(15)\n"
+     "std 10,144(15)\n"
+     "std 11,152(15)\n"
 
-     "std 8, 160(15)\n"
-     "std 9, 168(15)\n"
-     "std 10,176(15)\n"
-     "std 11,184(15)\n"
-     "std 12,192(15)\n"
-     "std 13,200(15)\n"
-     "std 14,208(15)\n"
-     "std 15,216(15)\n"
+     "std 12,16(15)\n"
+     "std 13,24(15)\n"
+     "std 14,32(15)\n"
+     "std 15,40(15)\n"
 
      "lgr 10, %[restore_state]\n" /* save 'restore_state' for later */
      "lgr 11, %[extra]\n"         /* save 'extra' for later */
@@ -35,7 +31,7 @@
 
      "lay 15,-160(15)\n"          /* create stack frame                 */
      "basr 14, 14\n"              /* call save_state()                  */
-     "lay 15, 160(15)\n"          /* destroy stack frame                */
+     "lay 15,160(15)\n"
 
      "cgij 2, 0, 8, zero\n"       /* skip the rest if the return value is null 
*/
 
@@ -47,31 +43,24 @@
                                  is already in r2                    */
      "lgr 3, 11\n"             /* arg 2: extra                       */
 
-
-     "lay 15, -160(15)\n"     /* create temp stack space for callee to use  */
-     "basr 14, 10\n"          /* call restore_state()               */
-     "lay 15, 160(15)\n"      /* destroy temp stack space           */
+     "lay 15,-160(15)\n"       /* create stack frame                 */
+     "basr 14, 10\n"           /* call restore_state()               */
+     "lay 15,160(15)\n"
 
      /* The stack's content is now restored. */
 
      "zero:\n"
 
      /* Epilogue */
-     /* no need */            /* restore stack pointer */
+     "ld 8,128(15)\n"
+     "ld 9,136(15)\n"
+     "ld 10,144(15)\n"
+     "ld 11,152(15)\n"
 
-     "ld 0,128(15)\n"
-     "ld 2,136(15)\n"
-     "ld 4,144(15)\n"
-     "ld 6,152(15)\n"
-
-     "ld 8, 160(15)\n"
-     "ld 9, 168(15)\n"
-     "ld 10,176(15)\n"
-     "ld 11,184(15)\n"
-     "ld 12,192(15)\n"
-     "ld 13,200(15)\n"
-     "ld 14,208(15)\n"
-     "ld 15,216(15)\n"
+     "ld 12,16(15)\n"
+     "ld 13,24(15)\n"
+     "ld 14,32(15)\n"
+     "ld 15,40(15)\n"
 
      "lmg 6,15,48(15)\n"
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to