mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-06 17:11:04 -04:00
829 B
829 B
§328 — THE VOLATILE ALIAS MUST BE AN OBJECT, NOT A CAST: *(volatile s32*)&sym UNFOLDS %lo INTO A SEPARATE addiu (P31 S67; byte-proven ov_SC07_007/func_80181B8C, 156 ins, NEW LAW)
Four identical lui/lw D_801C79A0; j LDDC; addiu tails needed TWO levers together:
(1) register __asm__("$2") pins on cases 0 and 3 — cc1 otherwise homes them in $v1, missing the
depth-2 merge onto .L80181DDC and deep-merging case 0 into case 3 at the shared jal; and
(2) an __asm__-aliased volatile OBJECT view of D_801C79A0 for case 3's reload only, to block
the back-merge into case 1's identical tail.
THE LAW: the volatile must be a declared aliased object (extern volatile s32 vD_x __asm__("D_801C79A0");).
Spelling it *(volatile s32*)&D_801C79A0 unfolds the %lo into a separate addiu and costs +1 ins.