public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@orcam.me.uk>
To: Nelson Chu <nelson@rivosinc.com>
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: Mon, 30 Jan 2023 03:33:55 +0000 (GMT)	[thread overview]
Message-ID: <alpine.DEB.2.21.2301300314540.55843@angie.orcam.me.uk> (raw)
In-Reply-To: <CAPpQWtAj5xoczt_8YNAwHK4mYNBfrsDqCz7gncX=6YUtWpPHew@mail.gmail.com>

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.

  Maciej

  reply	other threads:[~2023-01-30  3:33 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 [this message]
2023-01-31  1:51         ` Nelson Chu
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=alpine.DEB.2.21.2301300314540.55843@angie.orcam.me.uk \
    --to=macro@orcam.me.uk \
    --cc=andrew@sifive.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    --cc=jim.wilson.gcc@gmail.com \
    --cc=kito.cheng@sifive.com \
    --cc=nelson@rivosinc.com \
    --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).