public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Martin Sebor <msebor@gmail.com>,
	Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] final: Improve output for -dp and -fverbose-asm
Date: Fri, 01 Dec 2017 00:49:00 -0000	[thread overview]
Message-ID: <c9d7c0f0-815b-0132-209b-66fc820f319a@redhat.com> (raw)
In-Reply-To: <2393c7a7-60a9-29fd-4d0c-49523734201d@gmail.com>

On 11/30/2017 09:28 AM, Martin Sebor wrote:
> On 11/30/2017 04:16 AM, Segher Boessenkool wrote:
>> On Wed, Nov 29, 2017 at 08:46:41PM -0700, Martin Sebor wrote:
>>> On 11/29/2017 04:13 PM, Segher Boessenkool wrote:
>>>> This improves the assembler output (for -dp and -fverbose-asm) in
>>>> several ways.  It always prints the insn_cost.  It does not print
>>>> "[length = NN]" but "[c=NN l=NN]", to save space.  It does not add one
>>>> to the instruction alternative number (everything else starts counting
>>>> those at 0, too).  And finally, it tries to keep things lined up in
>>>> columns a bit better.
>>>>
>>>> Tested on powerpc64-linux {-m32,-m64}; is this okay for trunk?
>>>
>>> [c=NN l=NN] will be meaningless to those without some deeper
>>> insight into/experience with what's actually being printed.
>>> It might as well say [NN NN].  But such extreme terseness would
>>
>> Length isn't printed on all targets, fwiw.
>>
>>> seem to run counter to the documented purpose of -fverbose-asm
>>> to "Put extra commentary information in the generated assembly
>>> code to make it more readable."
>>
>> 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.
> 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.
> You can also remove the brackets and use length=NN to shave off
> a couple of bytes.  Or print length only when it's not the typical
> default.  Or print the hex encoding instead.
Some of those things may make sense as well.  Though we also have to be
careful because some points don't have length information at all.  SIgh.

> 
>>> Looking further in the manual I don't see the [length=NN] bit
>>> mentioned (nor does your patch add a mention of it) so while
>>> the meaning of [length=NN] isn't exactly obvious, using [l=NN]
>>> instead certainly won't make it easier to read.  Does the manual
>>> need updating?
>>
>> Should -fverbose-asm print length (and cost) at all?  They should be
>> printed for -dp (which is for debugging the *compiler*), but are they
>> very useful for -fverbose-asm (which is primarily for debugging the
>> *user program*)?
> 
> I don't have the answers to these questions.  What I can say
> is that using one letter abbreviations for short words is not
> going to make it more readable, on the contrary.  len= would
> be okay.
I think length and costing information are definitely things we want to
include.  Length is less of an issue now than it was in the past, but it
definitely has value.

jeff

  parent reply	other threads:[~2017-12-01  0:49 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
2017-11-30 17:14           ` 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:55             ` David Malcolm
2017-12-04 15:49               ` 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 [this message]
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=c9d7c0f0-815b-0132-209b-66fc820f319a@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@gmail.com \
    --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).