[PATCH] RISC-V: move various alias entries
Palmer Dabbelt
palmer@dabbelt.com
Fri Aug 25 13:23:21 GMT 2023
On Fri, 25 Aug 2023 06:01:07 PDT (-0700), jbeulich@suse.com wrote:
> On 05.08.2023 03:40, Tsukasa OI wrote:
>> On 2023/08/04 21:00, Jan Beulich via Binutils wrote:
>>> For disassembly to only use spec-mandated aliases, respective non-alias
>>> entries need to come ahead of their alias ones. Since identical
>>> mnemonics need to stay together, whole groups are moved up where
>>> necessary.
>>>
>>> This partly reverts 839189bc932e ("RISC-V: re-arrange opcode table for
>>> consistent alias handling"), but then also goes beyond a plain revert.
>>> ---
>>> I did not adjust JAL back, to continue to match JALR. The spec doesn't
>>> spell out how operands are to be specified, and hence it also doesn't
>>> mention how many explicit ones there are supposed to be.
>>>
>>> What about NEG, NEGW, and RET (and perhaps more)? The spec doesn't know
>>> of those afaics.
>>
>> I think JAL, NEG, NEGW and RET are okay as is.
>>
>> For JAL, I support Jan's opinion.
>>
>> For all instructions Jan pointed out (including JAL with one operand),
>> they are listed in the RISC-V Assembly Programmer's Manual:
>> <https://github.com/riscv-non-isa/riscv-asm-manual/blob/master/riscv-asm.md>
>> and should be considered safe
>> (unlike "add rd, rs1, IMM" == "addi rd, rs1, IMM").
IMO that's a reasonable rationale. The various RISC-V specs define
things in surprising places all the time, but users already need to deal
with that and there's really nothing we can do to change it. At least
this way we're generating disassembly that is defined somewhere, so
there's a better chance they'll be able to figue out what the mnemonics
mean.
>> I support merging this patch without modification (or perhaps, with
>> minor modification to the commit message?).
>>
>> Reviewed-by: Tsukasa OI <research_trasio@irq.a4lg.com>
>
> Arch maintainers - any view? I guess I'll wait another week or so and
> commit if I don't hear anything to the contrary.
Sorry for missing this. It looks good to me, so
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
but I remember talking about it at some point with Nelson. It's the
weekend already in Taiwain, so I'll try to remember to bug him on Monday
if he doesn't see this.
>
> Jan
More information about the Binutils
mailing list