mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-10 11:37:43 +01:00

You can encode a 12-bit immediate in a SUB instruction on ARM64. We can exploit this to avoid materializing the immediate. This approach saves an instruction if it does not need to be materialized in a register afterwards. Otherwise, we just materialize it later and the total number of instructions stays the same. Before: 0x5280003a mov w26, #0x1 ; =1 0xcb1a033b sub x27, x25, x26 After: 0xd100073b sub x27, x25, #0x1