Author: Richard Plangger <planri...@gmail.com> Branch: s390x-backend Changeset: r81872:3b1bb2d5dd4d Date: 2016-01-20 09:38 +0100 http://bitbucket.org/pypy/pypy/changeset/3b1bb2d5dd4d/
Log: removed print statement and exchanged it with llop.debug_print (thx mjacob) 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 @@ -1461,8 +1461,10 @@ pmc.overwrite() def notimplemented_op(asm, op, arglocs, regalloc): - print "[ZARCH/asm] %s not implemented" % op.getopname() - raise NotImplementedError(op) + if we_are_translated(): + msg = "[ZARCH/asm] %s not implemented\n" % op.getopname() + llop.debug_print(lltype.Void, msg) + raise NotImplementedError(msg) asm_operations = [notimplemented_op] * (rop._LAST + 1) asm_extra_operations = {} 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,29 +1215,39 @@ prepare_oplist = [notimplemented] * (rop._LAST + 1) -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: - missing.append(methname) +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))) - -del implemented_count -del total_count -del missing + 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))) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit