code wiki / (root) / nx_smoke_nxc_tilde.nx

nx_smoke_nxc_tilde.nx

buildroot/runtime/nx_smoke_nxc_tilde.nx

2850 B73 linesdepth 9pulls 28 transitivereach 0 importersview sourcekind smoketopic smoke
docsdependenciesstructsconstsfunctions

about

nx_smoke_nxc_tilde.nx -- 1:1 proof that the SELF-HOSTED RV64 backend (nx_riscv.nx) lowers `~` (OP_NOT) to `xori rd, rs, -1`. Mirrors nx_smoke_nxc_pipeline.nx but (a) the demo exercises `~` on a non- foldable parameter and (b) it WRITES the emitted RV64 asm to stdout so the gate can grep for the `xori ..., -1` one's-complement and confirm the OP_NOT lowering really fires (not the silent drop that existed before). Then it still assembles, proving nxasm accepts it. exit code: code_len & 0xFF on success (>0), or an error sentinel. license_tier: ORIGINAL

dependencies 12 imports · 0 importers

nx_syscalls.nx nx_types.nx nx_lex_kinds.nx nx_outbuf.nx nx_ir.nx nx_tokenizer.nx nx_parse.nx nx_opt.nx nx_regalloc.nx nx_riscv.nx nx_smoke_nxc_tilde.nx

diagram shows first 10 each side; +2 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_types.nxnx_lex_kinds.nxnx_outbuf.nxnx_ir.nxnx_tokenizer.nxnx_parse.nxnx_opt.nxnx_regalloc.nxnx_riscv.nxcrt0.nxnxasm_v2.nx

imported by: nobody (leaf or entry point)

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

main lex_source sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ lexm_expand lexm_prescan lexm_isid is_alnum is_alpha is_digit lexm_body_end lexm_define lexm_init sys_mmap ↻ lexm_warn_body_too_long lexm_diag_cell lexm_emit_str lexm_emit_dec sys_write ↻ lexm_name_at lexm_body_at sys_mmap ↻ lexm_isid ↻ lexm_body_end ↻ lexm_for_expand lexm_isid ↻ lexm_body_end ↻

structs

none

consts

none

functions

25func main() -> i64