Comment Re:ARM64 is a mess (Score 1) 160
Oh, and there are 31 registers - X0 through X30. The 32nd register is special depending on the instruction - for ADD and SUB, "X31" means the stack pointer. For most other instructions, it means the zero register (reads as zero), something borrowed from MIPS, and allowing interesting register-only instruction forms to be used when the immediate value is zero. It does result in oddball uses though, like SUB SP, 0, X0 ; Set SP. to play with the stack pointer.
Hi, since you seem to be familiar with AArch64, perhaps you could explain why X31 == 0 is preferrable to X31 == FF's (all 1's). At least with FF's I can do an Increment or Decrement using 2's complement math, as well as bitwise testing for non-zero bits (though CLZ might suffice). With X31 == 0, the use case seems more limited (zero constant can be encoded pretty easily as an IMMEDIATE, and I presume that TEQ/CMP against 0 still exists)? PS. I'm familiar with ARM32, and somewhat familiar with MIPS-style fixed register constant usage.