code wiki / _hdl_build / nx_mulh_diag.nx

nx_mulh_diag.nx

buildroot/runtime/_hdl_build/nx_mulh_diag.nx

1720 B29 linesdepth 5pulls 9 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_mulh_diag.nx -- decisive: compute mulh(0xffffffff86129b49, 0x00c50021) on the golden sim's ALU AND my fast interpreter's mulh64. QEMU says the answer is -1 (0xffffffffffffffff). Whichever gives -1 is correct. expect_exit:0

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_g_puts_lib.nx nishi_hdl_primitives.nx rv64im_min_decoder.nx rv64im_min_alu.nx nx_rv64_fast.nx nx_mulh_diag.nx

imports: nx_syscalls.nxnx_g_puts_lib.nxnishi_hdl_primitives.nxrv64im_min_decoder.nxrv64im_min_alu.nxnx_rv64_fast.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write g_ph16 g_puts ↻ sys_mmap sys_write ↻ nx_rv64im_alu_compute nx_rv64im_lshr nx_rv64im_ltu nx_rv64im_sext32 nx_rv64im_mulh_signed nx_rv64im_mulh_unsigned nx_rv64im_lshr ↻ nx_rv64im_mulh_signed_unsi nx_rv64im_mulh_unsigned ↻ nx_rv64im_mulh_unsigned ↻ nx_rv64im_udiv nx_rv64im_ltu ↻ nx_rv64im_urem nx_rv64im_udiv ↻ mulh64 mulhu64 mulhu64 ↻ sys_exit

structs

none

consts

none

functions

10func g_ph16(v: i64) -> i64 { g_puts("0x" as *u8); let b: *u8=sys_mmap(20); var i: i64=15; while i>=0 { let nib: i64=(v>>(i*4))&15; if nib<10 { b[15-i]=(48+nib) as u8 } else { b[15-i]=(87+nib) as u8 } i=i-1 } b[16]=10 as u8; sys_write(1,b,17); return 0 }
called by 1: main calls 3: g_putssys_mmapsys_write
12func main() -> i64