riscv.nx source
↩ module page · 28 lines · 1554 B
1// riscv.nx -- alias stub.
2//
3// Migration to the nx_-prefixed canonical name nx_riscv.nx. Consumers
4// via `import "riscv.nx"` resolve to nx_riscv.nx through NishiLang's
5// textual import splicing with path dedup (runtime/import.nx I1), the
6// same mechanism types.nx / ir.nx / outbuf.nx / regalloc.nx already use.
7//
8// WHY THIS FILE IS NOW A STUB (2026-07-13): the pre-migration riscv.nx
9// was a full 67 KB DUPLICATE of the RV64 backend that had diverged from
10// nx_riscv.nx and was missing two correctness fixes the canonical copy
11// carries:
12// - F14 VL_ALLOCA rematerialisation (materialise() kind==3 -> emits
13// `addi scratch, sp, off` at each use; fixes loop-carried alloca
14// clobber -- the nested-loop miscompile).
15// - OP_ADDR_OF (address-of-local; `let p = &x` -> materialise x's
16// address into the result home; fixes pointer-to-local miscompile).
17// Both were caught by the nxc-vs-qemu-system-riscv64 differential oracle
18// and proven fixed on the canonical backend (12/12 programs: golden sim
19// == real QEMU == nx_cc reference). Keeping the divergent duplicate was
20// the two-copies trap (nxc once imported this stale one); collapsing to
21// a single source of truth eliminates it by construction. Path dedup
22// means a file may import BOTH names with no duplicate-symbol error.
23//
24// Deprecation: delete this stub when every "riscv.nx" consumer (main.nx,
25// smoke_nxc_pipeline*.nx, riscv*_test.nx, rvv_regname_test.nx,
26// callee_save_test.nx, _offc_nxc_small.nx) has migrated to "nx_riscv.nx".
27
28import "nx_riscv.nx"