code wiki / _hdl_build / _enc_replace_gate.nx

_enc_replace_gate.nx

buildroot/runtime/_hdl_build/_enc_replace_gate.nx

2929 B60 linesdepth 2pulls 3 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

_enc_replace_gate.nx -- DIFFERENTIAL-REPLACEMENT of a COMPILER-INTERNAL (eve "inside like a compiler"): is the SEARCH-derived RV64 U-type encoder (nx_evo_enc's champion) behaviorally IDENTICAL to the Claude-authored assembler encoder? The operator's test on the toolchain's GUTS: "turn off Claude's encoder, emit ours, function the same." GREEN across the full in-range domain (every 7-bit opcode x every 5-bit register x an imm20 sample) = the team derived a verified drop-in for a piece of the assembler's inside. evo_enc_u is the SEARCH-emitted structure (_evo_enc_champ.nx), not hand-written. enc_u_ref is the REAL Claude encoder inlined VERBATIM from nxasm/asm_enc.nx:39-41 (cross-dir import doesn't resolve into _hdl_build; this is the production formula, citable). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx _evo_enc_champ.nx _enc_replace_gate.nx

imports: nx_syscalls.nx_evo_enc_champ.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main erg_imm evo_enc_u enc_u_ref erg_w sys_write erg_n sys_write ↻ sys_mmap sys_exit

structs

none

consts

none

functions

14func enc_u_ref(opcode: i64, rd: i64, imm20: i64) -> i64
called by 1: main
18func erg_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
19func erg_n(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
26func erg_imm(i: i64) -> i64
called by 1: main
33func main() -> i64