From: Martin Sebor <msebor@gmail.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] final: Improve output for -dp and -fverbose-asm
Date: Thu, 30 Nov 2017 17:02:00 -0000 [thread overview]
Message-ID: <dbbf5199-96cf-9d25-6711-eaedccf27c18@gmail.com> (raw)
In-Reply-To: <20171130164425.GB10515@gate.crashing.org>
On 11/30/2017 09:44 AM, Segher Boessenkool wrote:
> On Thu, Nov 30, 2017 at 09:28:44AM -0700, Martin Sebor wrote:
>>> The point is that [length = 12] takes up an awful lot of space. The
>>> output of -fverbose-asm alread suffers from information overload.
>>
>> Amount of space vs amount of detail are two different concerns.
>
> Yes.
>
>> If you feel that the output is overly detailed then adding even
>> more to it won't help. Other than that, I don't think trading
>> readability for space savings makes sense in a format whose main
>> purpose is to be readable. If it's line length that's a concern
>> then using spaces instead of tabs would make them look shorter.
>
> Trunk:
>
> ===
> .L.yk:
> cmpdi 0,4,0 # 8 *movdi_internal2/1 [length = 4]
> beq 0,.L2 # 9 *rs6000.md:12754 [length = 4]
> srdi 9,3,32 # 11 lshrdi3 [length = 4]
> xor 9,9,3 # 12 *boolsi3 [length = 4]
> rldicl 9,9,0,32 # 13 zero_extendsidi2/2 [length = 4]
> cmpd 7,9,3 # 14 *cmpdi_signed [length = 4]
> beq 7,.L7 # 15 *rs6000.md:12754 [length = 4]
> .L5:
> mr 3,4 # 32 *movdi_internal64/3 [length = 4]
> blr # 53 simple_return [length = 4]
> .L2:
> lwz 9,0(4) # 28 zero_extendsidi2/1 [length = 4]
> trap # 29 trap [length = 4]
> .L7:
> addic 4,9,-1 # 47 *adddi3_imm_carry_m1 [length = 4]
> subfe 4,4,9 # 48 *subfdi3_carry_in_internal [length = 4]
> b .L5 # 58 jump [length = 4]
> ===
>
> Patched:
> ===
> .L.yk:
> cmpdi 0,4,0 # 8 [c=4 l=4] *movdi_internal2/0
> beq 0,.L2 # 9 [c=4 l=4] *rs6000.md:12774
> srdi 9,3,32 # 11 [c=4 l=4] lshrdi3
> xor 9,9,3 # 12 [c=4 l=4] *boolsi3
> rldicl 9,9,0,32 # 13 [c=4 l=4] zero_extendsidi2/1
> cmpd 7,9,3 # 14 [c=4 l=4] *cmpdi_signed
> beq 7,.L7 # 15 [c=4 l=4] *rs6000.md:12774
> .L5:
> mr 3,4 # 32 [c=4 l=4] *movdi_internal64/2
> blr # 76 [c=4 l=4] simple_return
> .L2:
> lfiwzx 0,0,4 # 28 [c=8 l=4] zero_extendsidi2/2
> trap # 29 [c=4 l=4] trap
> .L7:
> addic 4,9,-1 # 70 [c=4 l=4] *adddi3_imm_carry_m1
> subfe 4,4,9 # 71 [c=4 l=4] *subfdi3_carry_in_internal
> b .L5 # 81 [c=4 l=4] jump
> ===
>
> It is neither line length nor amt of info that makes the second one
> way better readable.
The justification certainly makes it easier to read. But
the abbreviations make it harder to interpret. [c=4 l=4]
makes no sense to anyone not already familiar with what
it means.
There's nothing wrong with using mnemonics as long as they're
well established and commonly understood. Absent that, they
should be explained in some accessible document.
Not everyone who reads the verbose assembly is familiar with
GCC internals. Users read it to help debug problems in their
code. They shouldn't have to also study GCC source code to
understand what the contents mean.
Martin
next prev parent reply other threads:[~2017-11-30 16:54 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 23:37 Segher Boessenkool
2017-11-30 7:52 ` Martin Sebor
2017-11-30 11:54 ` Segher Boessenkool
2017-11-30 16:06 ` Michael Matz
2017-11-30 16:36 ` Martin Sebor
2017-11-30 16:50 ` Segher Boessenkool
2017-11-30 17:02 ` Martin Sebor [this message]
2017-11-30 17:14 ` Michael Matz
2017-11-30 17:55 ` David Malcolm
2017-12-04 15:49 ` Michael Matz
2017-11-30 17:55 ` Martin Sebor
2017-12-01 0:32 ` Jeff Law
2017-12-01 22:52 ` Segher Boessenkool
2017-12-04 12:39 ` Michael Matz
2017-11-30 17:15 ` Segher Boessenkool
2017-11-30 22:59 ` Martin Sebor
2017-12-01 0:26 ` Jeff Law
2017-12-01 0:49 ` Jeff Law
2017-12-01 23:45 ` Segher Boessenkool
2017-11-30 16:44 ` Kyrill Tkachov
2017-11-30 16:54 ` Michael Matz
2017-11-30 16:55 ` Kyrill Tkachov
2017-11-30 17:07 ` Michael Matz
2017-12-01 0:22 ` Jeff Law
2017-12-01 0:25 ` Jeff Law
2017-12-01 1:17 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dbbf5199-96cf-9d25-6711-eaedccf27c18@gmail.com \
--to=msebor@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=segher@kernel.crashing.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).