code wiki / _hdl_build / nx_superopt_general_test.nx
nx_superopt_general_test.nx
buildroot/runtime/_hdl_build/nx_superopt_general_test.nx
about
nx_superopt_general_test.nx -- (#1) the generator GENERALIZED beyond x*C-in-two-
terms. It authors an N-term shift/add chain for ANY constant via the non-adjacent
form (NAF), the canonical minimal signed-digit recoding (Reitwiesner, IRE Trans.
1960; Booth recoding). NAF gives the fewest +/- shifted terms, so the generator
handles constants the 2-term strength-reducer could NOT (x*100, x*11, x*13, ...).
Each authored chain is lowered through the SPEC ENCODER (nx_isa_spec) to RV64 AND
AArch64 and PROVEN BY EXECUTION on the sovereign emulators.
The team authors: I wrote the recoding + the lowering; the search/recoding writes
the term sequence and the spec table writes the bytes. Known answer: every
constant computes x*C on both arches -> exit 0.
dependencies 3 imports · 0 importers
imports: nx_isa_spec.nxnx_emu_rv64.nxnx_emu_arm64.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
| none |
functions
| 17 | func g_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 1: main |
| 18 | func g_num(v: i64) -> i64 called by 1: main |
| 26 | func g_put_w(code: *u8, o: i64, w: i64) -> i64 |
| 33 | func g_naf(C: i64, pos: *i64, sign: *i64) -> i64 called by 1: main |
| 50 | func g_run_rv(x: i64, pos: *i64, sign: *i64, nt: i64) -> i64 |
| 66 | func g_run_a64(x: i64, pos: *i64, sign: *i64, nt: i64) -> i64 |
| 81 | func main() -> i64 |