code wiki / (root) / nx_simd_bench.nx

nx_simd_bench.nx

buildroot/runtime/nx_simd_bench.nx

4132 B116 linesdepth 6pulls 9 transitivereach 0 importersview sourcekind benchtopic simd
docsdependenciesstructsconstsfunctions

about

nx_simd_bench.nx -- honest perf comparison: scalar i64 add vs SIMD i64x4 add over N=4096-element arrays. Honest cardinal: report WIN / TIE / LOSE based on actual measurements, NOT aspirational claims. Under qemu-user the vectorisation surface is FAITHFUL to the chip (real V instructions execute) but the wall-time is dominated by qemu's interpretive overhead, so wall-time ratios are NOT a clean SIMD-vs-scalar signal -- we report op-count + clock time both, with a note.

dependencies 3 imports · 0 importers

nx_kernel_v2.nx nx_log.nx nx_clock.nx nx_simd_bench.nx

imports: nx_kernel_v2.nxnx_log.nxnx_clock.nx

imported by: nobody (leaf or entry point)

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

main nx_clock_monotonic_ns sys_mmap sys_clock_gettime_mono bench_scalar bench_simd

structs

none

consts

21const N: i64 = 4096
22const REPS: i64 = 16

functions

24func bench_scalar(a: *i64, b: *i64, r: *i64) -> i64
called by 1: main
33func bench_simd(a: *i64, b: *i64, r: *i64) -> i64
called by 1: main
48func main() -> nx_exit