code wiki / _hdl_build / nx_f32_sse_kat_gate.nx

nx_f32_sse_kat_gate.nx

buildroot/runtime/_hdl_build/nx_f32_sse_kat_gate.nx

8052 B156 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic f32
docsdependenciesstructsconstsfunctions

about

nx_f32_sse_kat_gate.nx -- SOVEREIGN hardware IEEE-754 f32 scalar run-KAT: the FIRST rung of the CPU+GPU 3D stack, proving REAL single-precision float on the x86 FPU (xmm) end to end (NO gcc / NO qemu / NO binutils). AUTHOR=ORGAN, no-false-green. Why this rung: fx.nx states "NishiLang has no float type today" -- all prior "f32" was fixed-point or soft-float emulated in i64, never the CPU's float ALU. The sovereign x86 game/render stack must run on the actual hardware (CPU SSE float now; GPU f32 next). This gate proves the sovereign assembler now EMITS and the silicon EXECUTES scalar-single ops that an integer-only path CANNOT fake. It assembles four tiny programs with the team's own _offc/nxasm_x86_main.elf and EXECUTES the resulting ELFs (exit code = the computed integer): P0: (3.0+4.0)*5.0 = 35.0 -> cvtss2si -> exit 35 (addss+mulss on the FPU) P1: (3.0+4.0)*6.0 = 42.0 -> cvtss2si -> exit 42 (neg control: different operand, different correct result) P2: 7.0/2.0 = 3.5 -> cvtss2si -> exit 4 (divss + round-half-to-EVEN: real IEEE rounding) P3: 7.0/2.0 = 3.5 -> cvttss2si-> exit 3 (truncate toward zero) GREEN iff p0==35 && p1==42 && p2==4 && p3==3 && p0!=p1 && p2!=p3. The p2!=p3 pair is the killer: ONE 3.5 value converts to 4 (round) and 3 (truncate) ONLY if real hardware IEEE-754 semantics are engaged -- an integer fake cannot produce both. Run-proves SEVEN encoder forms: cvtsi2ss, addss, mulss, divss, cvtss2si, cvttss2si (+ the REX.W encoder twin x86_sse_rr_w). Writes knowledge/status/f32_sse_kat.log. license_tier: ORIGINAL Reuses the run/assemble spine from nx_simd_sse_kat_gate.

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_f32_sse_kat_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main write_f32_s sys_openat_wr gw sys_write sys_close asm_and_run sys_mmap g_run sys_mmap ↻ sys_openat_wr ↻ sys_fork sys_dup3 sys_execve sys_exit sys_wait4 sys_close ↻ g_emit gw ↻ gwn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close ↻

structs

none

consts

25const ASM_TOOL: *u8 = "_offc/nxasm_x86_main.elf"
26const SV_LOG: *u8 = "knowledge/status/f32_sse_kat.log"

functions

28func gw(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 2: write_f32_sg_emit calls 1: sys_write
29func gwn(fd: i64, v: i64) -> i64
called by 1: g_emit calls 2: sys_mmapsys_write
43func g_run(path: *u8, argv: *i64) -> i64
66func asm_and_run(spath: *u8, elfpath: *u8) -> i64
called by 1: main calls 2: sys_mmapg_run
83func write_f32_s(path: *u8, variant: i64) -> i64
called by 1: main calls 3: sys_openat_wrgwsys_close
122func g_emit(fd: i64, p0: i64, p1: i64, p2: i64, p3: i64, ok: i64) -> i64
called by 1: main calls 2: gwgwn
133func main() -> i64