[PATCH 1/3] RISC-V: prefer SLT{,U} aliases for SLTI{,U}
Maciej W. Rozycki
macro@orcam.me.uk
Sun Jan 15 04:35:22 GMT 2023
On Fri, 13 Jan 2023, Jan Beulich via Binutils wrote:
> While not spelled out by the spec, gas has been supporting these aliases
> virtually forever. Yet they were unused by the disassembler because of
> sitting later in the table. Move the non-aliases down.
I think this is going backwards. Aliases are used in disassembly to
improve readability, e.g. to show `nop', rather than `c.addi zero,0' which
would make anyone scratch their head, at least initially.
In this case there's no improvement, but obfuscation, as you're losing
the clear distinction between the register and the immediate instructions
and one will have to examine the operands to spot the difference.
The alternative mnemonic forms for immediate machine instructions are
there (NB pinched from the MIPS assembly dialect) to make it easier for
people to write handcoded assembly, especially where macros are involved,
either GAS or C preprocessor ones, and not for disassembly. Conceptually
they're assembly macros that expand to a single instruction rather than
aliases. IOW it's not a bug that those are not considered aliases for
disassembly.
Likewise with the remaining patches in this series.
Maciej
More information about the Binutils
mailing list