[pypy-commit] pypy s390x-backend: removed print statements, typo, removed push floats from stacklet because there is no need to save them

plan_rich pypy.commits at gmail.com
Tue Jan 26 03:08:16 EST 2016


Author: Richard Plangger <planrichi at gmail.com>
Branch: s390x-backend
Changeset: r81946:62aeb645010b
Date: 2016-01-26 09:07 +0100
http://bitbucket.org/pypy/pypy/changeset/62aeb645010b/

Log:	removed print statements, typo, removed push floats from stacklet
	because there is no need to save them

diff --git a/rpython/jit/backend/zarch/instructions.py b/rpython/jit/backend/zarch/instructions.py
--- a/rpython/jit/backend/zarch/instructions.py
+++ b/rpython/jit/backend/zarch/instructions.py
@@ -287,9 +287,3 @@
 all_mnemonic_codes.update(memory_mnemonic_codes)
 all_mnemonic_codes.update(floatingpoint_mnemonic_codes)
 all_mnemonic_codes.update(branch_mnemonic_codes)
-
-
-if __name__ == "__main__":
-    print("%d instructions:" % len(all_mnemonic_codes))
-    for name, (typeinstr, _) in all_mnemonic_codes.items():
-        print(" %s\t(type: %s)" % (name, typeinstr))
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
@@ -131,7 +131,7 @@
         if size == -1:
             size = self.size
         if size >= 2**19:
-            msg = '[S390X/literalpool] size exceeded %d >= %d\n' % (size, 2**19-8)
+            msg = '[S390X/literalpool] size exceeded %d >= %d\n' % (size, 2**19)
             if we_are_translated():
                 llop.debug_print(lltype.Void, msg)
             raise PoolOverflow(msg)
@@ -180,13 +180,8 @@
         asm.mc.write('\x00' * self.size)
         wrote = 0
         for val, offset in self.offset_map.items():
-            if not we_are_translated():
-                print('pool: %s at offset: %d' % (val, offset))
             self.overwrite_64(asm.mc, offset, val)
             wrote += 8
-        # for the descriptors
-        if not we_are_translated():
-            print "pool with %d quad words" % (self.size // 8)
 
     def overwrite_64(self, mc, index, value):
         index += self.pool_start
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,40 +1215,3 @@
     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,10 +12,7 @@
 
      "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"
+     "lay 15,-160(15)\n"          /* create stack frame                 */
 
      "lgr 10, %[restore_state]\n" /* save 'restore_state' for later */
      "lgr 11, %[extra]\n"         /* save 'extra' for later */
@@ -23,9 +20,7 @@
      "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 */
 
@@ -38,10 +33,8 @@
      "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. */
 
@@ -49,13 +42,7 @@
 
      /* Epilogue */
      /* no need */            /* restore stack pointer */
-
-     "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"
+     "lmg 6,15,208(15)\n"
 
      : "=r"(result)         /* output variable: expected to be r2 */
      : [restore_state]"r"(restore_state),       /* input variables */
diff --git a/rpython/translator/c/test/test_newgc.py b/rpython/translator/c/test/test_newgc.py
--- a/rpython/translator/c/test/test_newgc.py
+++ b/rpython/translator/c/test/test_newgc.py
@@ -698,7 +698,7 @@
             # related to libffi issue on s390x, we MUST
             # overwrite the full ffi result which is 64 bit
             # if not, this leaves garbage in the return value
-            # and qsort does not sorrt correctly
+            # and qsort does not sort correctly
             res = rffi.cast(rffi.SIGNEDP, ll_res)
             if a1 > a2:
                 res[0] = 1


More information about the pypy-commit mailing list