Files
BFM-decomp/cookbook/C0405.md
T

1.0 KiB

§364 ★ — THE libgpu P_TAG BITFIELD SPELLING IS OPT-LEVEL DEPENDENT (P31 S68; two functions, opposite verdicts, same session)

  • At -O0 the bitfield is REQUIRED. md_MAIN_003/func_800D0D6C (345 ins): the unsigned addr:24 read-modify-write is what makes store_fixed_bit_field expand the VALUE first and then the dest read, which fixes the final or's operand order. The hand-written (X & 0xFF000000) | (Y & 0xFFFFFF) gets the operands BACKWARDS.
  • At -O2 the bitfield is BYTE-WRONG. ov_SC01_000/func_8017E594 (357 ins): the bitfield sets MEM_IN_STRUCT_P, so the alias oracle CSEs the second D_800B9A02 load across the tag store — -4 instructions per block, 357 → 325. The manual mask/or form is required.

Same struct, same field, opposite correct spellings, decided by the TU's opt level. This is §351's /s dial with a concrete high-frequency victim, and the first case where the RIGHT answer FLIPS between -O0 and -O2. Check the TU's opt level before choosing the spelling.