feat(phase-18): VERDICT REVERSED — func_8012B8E4 hand-matched via register pinning

The 'unsteerable' regalloc-order class is NOT unsteerable. Drew's directive (hand-match
everything) exposed the lever I'd skipped: explicit register pinning.

- func_8012B8E4 (the flagship circular reach-134 'unsteerable' fn): 21 -> MATCH via
  * register pins: register s32 d __asm__("$16"); register s32 s1ang __asm__("$17")
    -> FORCES the $s0/$s1 global allocation gcc otherwise density-orders the other way
  * branch-polarity invert (§3-T4): 24->21
  * explicit clamp temps (t=u6+0x1000; iVar4=u5-t): fixes the reassociation, 7->3
  * scheduling barrier __asm__ __volatile__("" : : "r"(u5)): anchors the last sll, 3->MATCH
- byte-gated (harvest_verify, G3/P9) + propagated x134 (per-overlay gate); 134 byte-identical
- recipe = §10-family hand technique (pins + barriers); labor-intensive (per-fn register map
  from the asm) but it WORKS -> the circular tail IS hand-matchable, not asm-only
- supersedes the T1-T5 'unsteerable' verdict; cookbook §17 + PhaseEnd to be revised accordingly
This commit is contained in:
Drew T
2026-06-20 12:17:54 -06:00
parent bd9ee97854
commit f1bbcd241f
137 changed files with 302 additions and 271 deletions
+23
View File
@@ -17244,4 +17244,27 @@
return 0; \
}
#define DEFINE_func_8012B8E4() \
extern s16 D_80126CB8; \
extern s16 D_80126CB4; \
extern s32 ratan2(s32 a0, s32 a1); \
s32 func_8012B8E4(s32 arg0, s32 arg1) { \
register s32 d __asm__("$16"); \
register s32 s1ang __asm__("$17"); \
s32 u5; s32 u6; s32 iVar4; s32 q; s32 t; \
d = arg1; \
s1ang = *(s16 *)(*(s32 *)(arg0 + 0x20) + 0x12); \
u5 = (ratan2(*(s16 *)(arg0 + 0xE) - D_80126CB8, D_80126CB4 - *(s16 *)(arg0 + 6)) - 0x400) & 0xFFF; \
__asm__ __volatile__("" : : "r"(u5)); \
d = (s16)d; \
u6 = s1ang & 0xFFF; \
if (u6 == u5) return 0; \
iVar4 = u5 - u6; \
if (iVar4 > 0x800) { t = u6 + 0x1000; iVar4 = u5 - t; } \
if (iVar4 < -0x800) { t = u6 - 0x1000; iVar4 = u5 - t; } \
if (iVar4 >= 0) { q = iVar4 / d; if (q == 0) q = 1; } \
else { q = iVar4 / d; if (q == 0) q = -1; } \
return q; \
}
#endif