public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nelson Chu <nelson@rivosinc.com>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: Jan Beulich <jbeulich@suse.com>,
	Binutils <binutils@sourceware.org>,
	 Palmer Dabbelt <palmer@dabbelt.com>,
	Andrew Waterman <andrew@sifive.com>,
	 Jim Wilson <jim.wilson.gcc@gmail.com>,
	Kito Cheng <kito.cheng@sifive.com>
Subject: Re: [PATCH] RISC-V: don't disassemble unrecognized insns as .byte
Date: Tue, 31 Jan 2023 09:51:04 +0800	[thread overview]
Message-ID: <CAPpQWtB=MvYLUJpx34XUfPzFqD6dPJ-pFs_TuiLDFGEj0Fgmog@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2301300314540.55843@angie.orcam.me.uk>

On Mon, Jan 30, 2023 at 11:33 AM Maciej W. Rozycki <macro@orcam.me.uk> wrote:
>
> Hi Nelson,
>
> > 0000000000000000 <.text>:
> >    0: 0001                .short 0x0001
> >    2: 0001                .2byte 0x1
> >    4: 0001                .short 0x0001
> > ...
> >
> > The .<N>byte in assembly will also be treated as data to dump, so
> > ideally, dump these unrecognized instructions as .insn is probably
> > more reasonable and won't be confused.
>
>  I wasn't aware about the RISC-V `.insn' pseudo-op.  I think it will make
> a lot of sense to use it here then, so I'd be happier with either:
>
>    2: 0001                .insn 0x0001
>
> or:
>
>    2: 0001                .insn 0x2, 0x1
>
> and analogously for unrecognised instructions comprised of a higher number
> of parcels according to the opcode allocation, e.g.:
>
> Disassembly of section .text:
> 0000000000000000 <foo> .insn    0x00000000001f
>
> or:
>
> Disassembly of section .text:
> 0000000000000000 <foo> .insn    0x6, 0x1f
>
> (here in the `--prefix-addresses' format).  The single-argument format may
> by clearer to the casual eye at the cost of extra leading zeros with some
> encodings.

Yeah, dump these unrecognized instructions into the .insn directives
with the <bytes> field looks better.  Thanks for pointing this out :-)

Nelson

  reply	other threads:[~2023-01-31  1:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 13:14 Jan Beulich
2023-01-30  1:40 ` Nelson Chu
2023-01-30  1:51   ` Maciej W. Rozycki
2023-01-30  3:03     ` Nelson Chu
2023-01-30  3:33       ` Maciej W. Rozycki
2023-01-31  1:51         ` Nelson Chu [this message]
2023-01-30  2:07   ` Kito Cheng
2023-01-30  7:51   ` Jan Beulich

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='CAPpQWtB=MvYLUJpx34XUfPzFqD6dPJ-pFs_TuiLDFGEj0Fgmog@mail.gmail.com' \
    --to=nelson@rivosinc.com \
    --cc=andrew@sifive.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    --cc=jim.wilson.gcc@gmail.com \
    --cc=kito.cheng@sifive.com \
    --cc=macro@orcam.me.uk \
    --cc=palmer@dabbelt.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).