[PATCH 1/3] RISC-V: re-arrange opcode table for consistent alias handling
Jan Beulich
jbeulich@suse.com
Mon Jul 17 06:50:00 GMT 2023
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
More information about the Binutils
mailing list