[pypy-commit] pypy s390x-backend: fixed translation issue. reverted the stacklet changes (did not pass test)

plan_rich pypy.commits at gmail.com
Tue Jan 26 10:46:06 EST 2016


Author: Richard Plangger <planrichi at gmail.com>
Branch: s390x-backend
Changeset: r81949:fb7bbc354de2
Date: 2016-01-26 16:40 +0100
http://bitbucket.org/pypy/pypy/changeset/fb7bbc354de2/

Log:	fixed translation issue. reverted the stacklet changes (did not pass
	test)

diff --git a/rpython/jit/backend/zarch/regalloc.py b/rpython/jit/backend/zarch/regalloc.py
--- a/rpython/jit/backend/zarch/regalloc.py
+++ b/rpython/jit/backend/zarch/regalloc.py
@@ -1215,3 +1215,41 @@
     raise NotImplementedError(msg)
 
 prepare_oplist = [notimplemented] * (rop._LAST + 1)
+
+if not we_are_translated():
+    implemented_count = 0
+    total_count = 0
+    missing = []
+    for key, value in rop.__dict__.items():
+        key = key.lower()
+        if key.startswith('_'):
+            continue
+        total_count += 1
+        methname = 'prepare_%s' % key
+        if hasattr(Regalloc, methname):
+            func = getattr(Regalloc, methname).im_func
+            prepare_oplist[value] = func
+            implemented_count += 1
+        else:
+            if not methname.startswith('prepare_vec') and \
+               not methname.startswith('prepare_get') and \
+               not methname.startswith('prepare_raw') and \
+               not methname.startswith('prepare_unicodesetitem') and \
+               not methname.startswith('prepare_unicodegetitem') and \
+               not methname.startswith('prepare_strgetitem') and \
+               not methname.startswith('prepare_strsetitem') and \
+               not methname.startswith('prepare_call_loopinvariant') and \
+               not methname.startswith('prepare_call_pure') and \
+               not methname.startswith('prepare_new') and \
+               not methname.startswith('prepare_set'):
+                missing.append(methname)
+            else:
+                implemented_count += 1
+
+    if __name__ == '__main__':
+        for m in missing:
+            print(" " * 4 + m)
+        print
+        print("regalloc implements %d of %d = %.2f%% of all resops" % \
+              (implemented_count, total_count, (100.0 * implemented_count / total_count)))
+
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
@@ -12,7 +12,10 @@
 
      "stmg 6,15,48(15)\n"
 
-     "lay 15,-160(15)\n"          /* create stack frame                 */
+     "std 0,128(15)\n"
+     "std 2,136(15)\n"
+     "std 4,144(15)\n"
+     "std 6,152(15)\n"
 
      "lgr 10, %[restore_state]\n" /* save 'restore_state' for later */
      "lgr 11, %[extra]\n"         /* save 'extra' for later */
@@ -20,7 +23,9 @@
      "lgr 2, 15\n"                /* arg 1: current (old) stack pointer */
      "lgr 3, 11\n"                /* arg 2: extra                       */
 
+     "lay 15,-160(15)\n"          /* create stack frame                 */
      "basr 14, 14\n"              /* call save_state()                  */
+     "lay 15, 160(15)\n"          /* destroy stack frame                */
 
      "cgij 2, 0, 8, zero\n"       /* skip the rest if the return value is null */
 
@@ -33,8 +38,10 @@
      "lgr 3, 11\n"             /* arg 2: extra                       */
 
 
+     "lay 15, -160(15)\n"     /* create temp stack space for callee to use  */
      "lgr 14, 10\n"           /* load restore_state                 */
      "basr 14, 14\n"          /* call restore_state()               */
+     "lay 15, 160(15)\n"      /* destroy temp stack space           */
 
      /* The stack's content is now restored. */
 
@@ -42,7 +49,13 @@
 
      /* Epilogue */
      /* no need */            /* restore stack pointer */
-     "lmg 6,15,208(15)\n"
+
+     "ld 0,128(15)\n"
+     "ld 2,136(15)\n"
+     "ld 4,144(15)\n"
+     "ld 6,152(15)\n"
+
+     "lmg 6,15,48(15)\n"
 
      : "=r"(result)         /* output variable: expected to be r2 */
      : [restore_state]"r"(restore_state),       /* input variables */


More information about the pypy-commit mailing list