code wiki / _hdl_build / nx_modtest.nx

nx_modtest.nx

buildroot/runtime/_hdl_build/nx_modtest.nx

1011 B19 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_modtest.nx -- MODOPT-001 gate witness: a hot loop with x % 2^k (% 1024). Production compiler emits IDIV (slow); with the opt_strength_reduce % 2^k -> & (2^k-1) patch the compiler should emit AND (fast). The RESULT must be identical either way (correctness); the .s changes idivq -> andq (the win). i is a loop counter (>= 1) so VRA should prove non-negative.

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_estr.nx nx_modtest.nx

imports: nx_syscalls.nxnx_estr.nx

imported by: nobody (leaf or entry point)

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

main es_putn sys_mmap sys_write sys_write ↻

structs

none

consts

7const K_MAGIC_50000000: i64 = 50000000
8const K_MAGIC_1024: i64 = 1024

functions

12func main() -> i64