mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-08 09:43:04 -04:00
874 B
874 B
§253 — POSTFIX ++ vs += 1 PICKS A DIFFERENT SCRATCH REGISTER (single observation — not yet cross-confirmed) (P31 S58b)
func_8017C104 (ov_SC06_000, 10 ins): two independent u16 halfword adds on a0. gcc-2.7.2 assigns
the FIRST-emitted load to $v0 and the second to $v1. Writing the +0x2 update as += 1
allocated it to $v0 (wrong); writing it as a postfix ++ while the +0xE update stays += 0x10
produced the target exactly:
lhu v0,0xE ; lhu v1,2 ; addiu v0,0x10 ; addiu v1,1 ; sh v0,0xE ; sh v1,2
§165-06 records that increment-operator vs compound-assignment differ by one expand instruction (and
func_80186B84/func_80186B14 confirm (*p)++ is mandatory there); this card says the axis also
reaches the allocator's vreg choice for otherwise identical expressions. One card only — probe it,
do not assume it.