On 1/12/21 9:44 PM, Richard Henderson wrote:
> On 1/12/21 8:41 AM, Philippe Mathieu-Daudé wrote:
>> Some ISA use a dot in their opcodes. Allow the decodetree
>> script to process them. The dot is replaced by an underscore
>> in the generated code.
> 
> Given that you then have to remember to use '_' on the C side, what advantage
> does this give?

The direct advantage is you can copy/paste the opcode in a PDF viewer
without having to edit it :)

See i.e. some Loongson opcodes [*]:

MULT.G          011100 ..... ..... ..... 00000 010000   @rs_rt_rd
DMULT.G         011100 ..... ..... ..... 00000 010001   @rs_rt_rd
MULTU.G         011100 ..... ..... ..... 00000 010010   @rs_rt_rd
DMULTU.G        011100 ..... ..... ..... 00000 010011   @rs_rt_rd

DIV.G           011100 ..... ..... ..... 00000 010100   @rs_rt_rd
DDIV.G          011100 ..... ..... ..... 00000 010101   @rs_rt_rd
DIVU.G          011100 ..... ..... ..... 00000 010110   @rs_rt_rd
DDIVU.G         011100 ..... ..... ..... 00000 010111   @rs_rt_rd

MOD.G           011100 ..... ..... ..... 00000 011100   @rs_rt_rd
DMOD.G          011100 ..... ..... ..... 00000 011101   @rs_rt_rd
MODU.G          011100 ..... ..... ..... 00000 011110   @rs_rt_rd
DMODU.G         011100 ..... ..... ..... 00000 011111   @rs_rt_rd

The other - remote - advantage I see is when using a disassembler
based on decodetree (as AVR does), the opcode displayed also matches
the specs. We are not yet there with MIPS, but I have something in
progress...

[*] https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg02509.html

Reply via email to