code wiki / _hdl_build / nx_simd_isa.nx

nx_simd_isa.nx

buildroot/runtime/_hdl_build/nx_simd_isa.nx

2360 B50 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic simd
docsdependenciesstructsconstsfunctions

about

nx_simd_isa.nx -- a sovereign VECTOR ISA + SIMD emulator, so vectorized kernels run as real vector MACHINE CODE and are proven by EXECUTION (the way we proved the scalar RV64/ARM/x86 emit). Bits-up: Nishi has its own vector extension; the AVX2 / NEON / RVV emit is then a DEPLOY-TIME lowering of this ISA to whatever vector unit the spore/seed lands on (vertical co-design at the deploy boundary). 8 vector registers x SV_W lanes (i64). Instruction = 2 words: [op|vd|va|vb, imm]. Ops: VLOAD vd,[imm] VSTORE [imm],va VADD/VMUL/VSUB vd,va,vb. One vector op does SV_W lanes -- the throughput the uops.info/nanoBench cost model prices.

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_simd_isa.nx nx_simd_isa_test.nx

imports: nx_syscalls.nx

imported by: nx_simd_isa_test.nx

structs

none

consts

13const SV_W: i64 = 8
15const SVOP_HALT: i64 = 0
16const SVOP_VLOAD: i64 = 1
17const SVOP_VSTORE: i64 = 2
18const SVOP_VADD: i64 = 3
19const SVOP_VMUL: i64 = 4
20const SVOP_VSUB: i64 = 5

functions

23func sv_emit(prog: *i64, idx: i64, op: i64, vd: i64, va: i64, vb: i64, imm: i64) -> i64
called by 1: main
32func sv_run(prog: *i64, ninstr: i64, vregs: *i64, mem: *i64) -> i64
called by 1: main