Files
BFM-decomp/cookbook/C0424.md
T

1.1 KiB

§383 — TWO TOOLCHAIN FACTS THE PACKS DID NOT CARRY (P31 S69)

  1. maspsx requires DECIMAL memory-operand offsets in verbatim asm. 0x40($sp) dies with invalid literal for int() with base 10; write 64($sp). Hex is fine for plain immediates. Found while banking main/func_80026514 (239 ins) the §265 verbatim-asm way — that function is genuinely HANDWRITTEN: its D_800B99DA fetch is a gas macro expansion of lbu $v1,0xA3AA($t2) into lui $at,1 / addu $at,$t2,$at / lbu $v1,-0x5C56($at), which gcc cannot emit.
  2. A 4-byte struct local is BLKmode, so assign_stack_local gives it 8-byte BIGGEST_ALIGNMENT. Declaring xy0/xy1 as s32 instead of a 4-byte struct is the difference between frame 0x130 and 0x138 (func_8001EFE0).
  3. convert_modes returns x unchanged when oldmode == GET_MODE(x), so no cast can emit the (s16) sll/sra pair. Only an s16 local assigned in one block and consumed in a distant one does — and the copy must sit ABOVE the guard, or it coalesces away against the target's addu $a1,$v0,$zero (func_8002D904).