public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Burgess <aburgess@redhat.com>, binutils@sourceware.org
Subject: Re: [PATCH] libopcodes/ppc: add support for disassembler styling
Date: Thu, 14 Jul 2022 20:48:39 +0930	[thread overview]
Message-ID: <Ys/7j3H+A4VChlFD@squeak.grove.modra.org> (raw)
In-Reply-To: <ea25f2eb-85d4-532f-cf0c-512f0bd72abd@suse.com>

On Thu, Jul 14, 2022 at 08:08:07AM +0200, Jan Beulich wrote:
> On 14.07.2022 04:09, Alan Modra via Binutils wrote:
> > On Tue, Jul 12, 2022 at 02:36:09PM +0100, Andrew Burgess via Binutils wrote:
> >> I think the only slightly weird case was how things like '4*cr1+eq'
> >> are styled.  As best I can tell, this construct, used for example in
> >> this instruction:
> >>
> >>   crand   4*cr1+lt,4*cr1+gt,4*cr1+eq
> >>
> >> is used to access a field of a control register (NOTE: I know very
> >> little about the PPC ISA, so please correct me if I'm wrong).  As
> >> such, I have styled the entire construct as a register.  In some cases
> >> constructs similar to the above can be simplified to just 'eq', as
> >> this is still referencing a register field, this is still styled as a
> >> register.
> > 
> > This field is also present in conditional branches, and looking at
> > those is perhaps is the best way to understand what ought to be done
> > here.
> > 
> > eg. this instruction
> > lab: beq 7,lab
> > disassembles with "objdump -d" to
> > 	beq cr7,0 <lab>
> > and with "objdump -d -Mraw" to see the underlying hardware insn
> > 	bc 12,4*cr7+eq,0 <lab>
> > 
> > So the field probably ought to disassemble the "4*" and "+" as text,
> > the "eq" the same as the opcode mnemonic,
> 
> Or maybe that new type which was introduced for Arm64?

Yes, dis_style_sub_mnemonic works too.

> > and the "cr7" as a
> > register.  At least, that seems a reasonable way to highlight the
> > "interesting bits" to me.

-- 
Alan Modra
Australia Development Lab, IBM

  reply	other threads:[~2022-07-14 11:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12 13:36 Andrew Burgess
2022-07-14  2:09 ` Alan Modra
2022-07-14  6:08   ` Jan Beulich
2022-07-14 11:18     ` Alan Modra [this message]
2022-07-18 16:31 ` [PATCHv2 0/2] PPC Styled Disassembler Support Andrew Burgess
2022-07-18 16:31   ` [PATCHv2 1/2] opcodes: add new sub-mnemonic disassembler style Andrew Burgess
2022-07-18 16:31   ` [PATCHv2 2/2] libopcodes/ppc: add support for disassembler styling Andrew Burgess
2022-07-21  9:31     ` Alan Modra
2022-07-25 13:14       ` Andrew Burgess

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=Ys/7j3H+A4VChlFD@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=aburgess@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    /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).