I can never remember which names are mapped to the same register. I've had that issue on x86 and I'll have that issue on ARM.
I loved how Motorola 68000 made it simple. Each command had a dot-letter suffix indicating the length: move.b d0, d1
I can never remember which names are mapped to the same register. I've had that issue on x86 and I'll have that issue on ARM.
I loved how Motorola 68000 made it simple. Each command had a dot-letter suffix indicating the length: move.b d0, d1
For 32-bit Arm, unfortunately, things are different: D0 is the bottom half of Q0, and D1 the top half; similarly S0 is the bottom half of D0 and S1 is the top half (and so Q0 is S0 S1 S2 S3, with S3 its most significant 32 bits). This is why "just indicate the length on the insn" wouldn't have worked for 32-bit: there is more than one 32-bit register in each 64-bit register (and some kind of 'high/low' notation would have been annoying when you really do want to just think of it as a collection of 32-bit registers sometimes, especially if your hardware doesn't even have double-precision support!). The 64-bit transition fixed up the awkward overlaid mapping, but retains the notation for the benefit of all the people who were already familiar with the Arm notational conventions for things.
For general purpose registers: X=long (64-bit), W=word (32-bit)
Also, on 68k you can only address the least significant word or byte of a register that way. Some CPUs have, say, 8 8-bit registers that can alternatively be treated as 4 16-bit registers (https://en.wikipedia.org/wiki/Intel_8080#Registers). On such a CPU, one can write to the top half of a register in a single instruction by writing to the 8-bit register that shares its storage (some RISC CPUs support that by having a separate instruction “load top half of register”)
It doesn't seem to be as confusing as the x86 situation anyway: none of the registers are _really_ special purpose on ARM.
Here's a link to the details in the ARM64 APCS: https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aap...