regalloc_fpr_evict_test.nx
buildroot/runtime/regalloc_fpr_evict_test.nx
about
regalloc_fpr_evict_test.nx -- proves linear_scan_fpr's eviction
policy fires. Companion smoke to regalloc_evict_test.nx.
No public ir_const_f64 / ir_emit_fcast builders exist yet, so we
construct Interval entries directly (linear_scan_fpr is leaf-
callable: it takes intv + sorted_ids + n + mask + spill_start
without touching the Function pointer). The 22-interval workload
matches the FPR pool size of 21 (9 caller-clobbered ft-regs after
the 3 scratch exclusions + 12 callee-saved fs-regs).
Construction: intv[i].end is monotonically decreasing in i, so
intv[0] has the LATEST end and intv[21] has the EARLIEST. All
crosses_call=0 so the want_cs=0 path is exercised. When intv[21]
arrives and the pool is empty, the eviction policy walks active[]
backward and finds intv[0] (latest end, in an ft-reg). Since
intv[0].end > intv[21].end, evict intv[0]; intv[21] gets that
register.
Assertion:
intv[0].reg == -1 (spilled by eviction)
intv[0].slot >= 0 (spill slot assigned)
intv[21].reg >= FREG_BASE_T (got a float register)
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_types.nxnx_regalloc.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 28 | const N_FLOATS: i64 = 22 // 21 reg pool + 1 forces exactly 1 spill |
functions
| 30 | func main() -> i64 |