[PATCH 1/3] RISC-V: prefer SLT{,U} aliases for SLTI{,U}

Jan Beulich jbeulich@suse.com
Thu Jan 26 09:41:21 GMT 2023


On 25.01.2023 16:22, Maciej W. Rozycki wrote:
> On Wed, 25 Jan 2023, Jan Beulich wrote:
> 
>>>  This is however what these instructions have been named in the ISA and 
>>> the assembly dialect.  In the case of NOP, MOVE, etc. mnemonics they are 
>>> significant assembly idioms (usually mentioned in the ISA manual) and 
>>> there are sometimes thousands of alternative encodings that could be used 
>>> to effect the same operation, but only the chosen canonical encoding is 
>>> disassembled this way.
>>
>> Aren't you changing topics? Being able to use alternative encodings to
>> achieve the same effect isn't what we were talking about.
> 
>  No, it just gives you background as to why some encodings are given 
> canonical aliases (used for disassembly) and why some are not.
> 
>>>  It's rather how the assembly language has been designed (FWIW the RISC-V 
>>> ISA and assembly dialect have been largely inspired by the MIPS approach).  
>>
>> Well, such a design imo ought to include a clear statement on uses of
>> aliases. Iirc at least the 32-bit Arm ARM is very precise about what
>> aliases exist, and it effectively mandates for at least some of them
>> that they should be use in disassembly.
>>
>> As said before, I'd be happy to see things move in about any direction,
>> just as long as the result is consistent and hence observable behavior
>> is predictable for users of the assembler and disassembler.
> 
>  It's been consistent so far AFAICT for the RISC-V assembly dialect (and 
> for that matter for the MIPS one as well).  If you disagree, then you're 
> welcome to present your view, but I think the context of libopcodes and 
> the binutils mailing list is not the correct place to discuss the assembly 
> language syntax.  You'd need to take it to the RISC-V ISA maintainters and 
> then we can implement whatever they've agreed to.

This, I'm afraid, is again a biased view. ISA and assembly syntax aren't
necessarily connected. See the (odd in my personal view) AT&T syntax which
has been the favorite one in the Unix world for x86, yet is entirely
disconnected from the ISA specifications coming from the relevant x86
vendors (all using so called Intel syntax, which really dates back to
MASM / TASM). Of course an architecture is free to define a "preferred"
assembly language, but I guess that's still distinct from the ISA spec,
and I'm unaware of a specific assembly syntax spec for RISC-V (which
Andrew's reply looks to support).

Jan


More information about the Binutils mailing list