[PATCH 1/3] RISC-V: re-arrange opcode table for consistent alias handling
Song Fangrui
i@maskray.me
Fri Jul 21 22:16:56 GMT 2023
On Sun, Jul 16, 2023 at 11:50 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 15.07.2023 00:08, Stefan O'Rear wrote:
> > On Fri, Jul 14, 2023, at 5:25 PM, Fangrui Song wrote:
> >> On Wed, Jul 12, 2023 at 1:15 AM Jan Beulich <jbeulich@suse.com> wrote:
> >>> On 11.07.2023 23:02, Fangrui Song wrote:
> >>>> I apologize as I haven't read all prior discussions. For many
> >>>> instructions, the "i" form is written in the ISA manual and prevalent.
> >>>
> >>> Why "prevalent"? The "i"-less forms are mentioned there as well, aren't
> >>> they? Then why not use them ...
> >>
> >> I think aliases like "add rd,rs,imm" (without "i") should be treated
> >> as deprecated aliases that we keep just for compatibility.
>
> That's a matter of taste, I'm inclined to say. But see below.
>
> >> We should not endorse the use cases by making objdump -d "prefer" this form.
> >>
> >> When I brought up the topic in the #riscv channel on libera.chat, I
> >> got a lot of complaints about having these "deprecated" aliases from
> >> folks, including courmisch, jrtc27, muurkha, sorear.
> >> As I happen to know two folks' email addresses, I have CCed them in this thread.
> >>
> >>>> I wonder whether we can give these add/and/xor/etc without "i" lower
> >>>> priority so that objdump -d will not show them, even without using -M
> >>>> no-aliases.
> >>>
> >>> ... unless use of aliases was suppressed? In other arches' assembly
> >>> that I know (to some degree) and which knows the concept of aliases,
> >>> aliases are typically the preferred way of disassembling, for
> >>> typically producing easier to grok output.
> >>
> >> AIUI aliases for other architectures are indeeded preferred (use my
> >> understanding of llvm-objdump -d output).
> >> This RISC-V case is not, though.
> >
> > The aliases that are documented in [1] are preferred for use in disassembly.
> > The other aliases, which gas supports for compatibility with old versions of
> > itself but which were never part of any spec, are not preferred.
>
> This would be a fair policy, as long as there's a not overly troublesome
> way of getting further entries on that list (whenever obvious instances
> turn up). My main goal, after all, is consistency. What exact policy
> underlies this is secondary to me.
>
> Jan
Jan and Nelson, If this is agreed that we should use "addi" instead of
the gas alias "add" in situations like addi x0, x0, 1, can either of
you make a change to restore the old behavior? Thanks!
More information about the Binutils
mailing list