code wiki / _hdl_build / nx_superopt_opt_test.nx

nx_superopt_opt_test.nx

buildroot/runtime/_hdl_build/nx_superopt_opt_test.nx

5155 B108 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic superopt
docsdependenciesstructsconstsfunctions

about

nx_superopt_opt_test.nx -- the optimal superoptimizer finds the SHORTEST program for a set of functions (constant-multiply + branchless bit-tricks), verified over FULL-RANGE 64-bit inputs (negatives, sign bit). Reports the op count, which is the number to put 1:1 against gcc -O2's instruction count in the honest board. Known answer: every target's shortest program found + held-out verified -> exit 0.

dependencies 1 imports · 0 importers

nx_superopt_opt.nx nx_superopt_opt_test.nx

imports: nx_superopt_opt.nx

imported by: nobody (leaf or entry point)

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

main op_puts op_target so_find sys_mmap so_enum so_matches so_eval so_is_shift so_imm so_enum ↻ op_name op_num op_describe op_puts ↻ op_opname op_num ↻ so_is_shift ↻ so_eval ↻

structs

none

consts

none

functions

9func op_puts(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 2: op_describemain
10func op_num(v: i64) -> i64
called by 2: op_describemain
18func op_opname(o: i64) -> *u8
called by 1: op_describe
24func op_describe(op: *i64, a: *i64, b: *i64, L: i64) -> i64
35func op_target(id: i64, x: i64) -> i64
called by 1: main
43func op_name(id: i64) -> *u8
called by 1: main
52func main() -> i64