nx_types.nx
buildroot/runtime/nx_types.nx
about
dependencies 0 imports · 88 importers
diagram shows first 10 each side; +0 more imports, +78 more importers in the complete lists below.
imports: none
imported by: _offc_probe_callchain.nx_offc_probe_irbuild.nx_offc_probe_irfn.nx_offc_probe_module.nx_offc_regalloc_min.nxend2end_test.nxnx_a11y_check.nxnx_a11y_check_test.nxnx_attack_taxonomy.nxnx_attack_taxonomy_test.nxnx_compile_wat.nxnx_compile_x86.nxnx_decl_base.nxnx_decl_base_test.nxnx_decl_combat_arena.nxnx_decl_combat_arena_test.nxnx_decl_dungeon_floor.nxnx_decl_dungeon_floor_test.nxnx_decl_random_environment.nxnx_decl_random_environment_test.nxnx_decl_reflection_test.nxnx_decl_simple_scene.nxnx_decl_simple_scene_test.nxnx_decl_townscape.nxnx_decl_townscape_test.nxnx_dom_fn.nxnx_dom_oracle_gate.nxnx_ir.nxnx_ir_dump.nxnx_ir_validate.nxnx_lang_struct.nxnx_license_check.nxnx_license_check_test.nxnx_license_wall_audit.nxnx_main.nxnx_math_basics.nxnx_math_basics_test.nxnx_nxc.nxnx_opt.nxnx_parse.nxnx_quality_grade.nxnx_quality_grade_daemon.nxnx_quality_grade_quad.nxnx_quality_grade_self.nxnx_quality_grade_septagon.nxnx_quality_grade_test.nxnx_regalloc.nxnx_regalloc_liveness_diag.nxnx_regalloc_soundness_test.nxnx_riscv.nxnx_safety_critical_grade.nxnx_safety_critical_grade_test.nxnx_smoke_nxc_pipeline.nxnx_smoke_nxc_pipeline10.nxnx_smoke_nxc_pipeline11.nxnx_smoke_nxc_pipeline12.nxnx_smoke_nxc_pipeline13.nxnx_smoke_nxc_pipeline14.nxnx_smoke_nxc_pipeline15.nxnx_smoke_nxc_pipeline2.nxnx_smoke_nxc_pipeline3.nxnx_smoke_nxc_pipeline4.nxnx_smoke_nxc_pipeline5.nxnx_smoke_nxc_pipeline6.nxnx_smoke_nxc_pipeline7.nxnx_smoke_nxc_pipeline8.nxnx_smoke_nxc_pipeline9.nxnx_smoke_nxc_tilde.nxnx_smoke_regalloc_min.nxnx_smoke_regalloc_min2.nxnx_smoke_regalloc_min3.nxnx_smoke_regalloc_min4.nxnx_smoke_regalloc_min5.nxnx_smoke_regalloc_min6.nxnx_smoke_regalloc_min7.nxnx_smoke_regalloc_step.nxnx_tokenizer.nxnx_vcc_color_wat.nxnx_vcc_probe_wat.nxnx_wasm.nxnx_x86_64_ctx.nxnx_x86_64_ctx_test.nxnx_x86_64_module_test.nxnx_x86_regalloc.nxregalloc_evict_test.nxregalloc_fpr_evict_test.nxregalloc_test.nxtypes.nx
structs
| 26 | struct Type { |
| 79 | struct StructField { |
| 88 | struct Value { |
| 102 | struct Instr { |
| 139 | struct BasicBlock { |
| 159 | struct Function { |
| 195 | struct Module { |
| 215 | struct Global { |
| 228 | struct ValueLoc { |
consts
| 248 | const OP_ADD: i64 = 1 |
| 249 | const OP_SUB: i64 = 2 |
| 250 | const OP_MUL: i64 = 3 |
| 251 | const OP_DIV_S: i64 = 4 |
| 252 | const OP_DIV_U: i64 = 5 |
| 253 | const OP_REM_S: i64 = 6 |
| 254 | const OP_REM_U: i64 = 7 |
| 255 | const OP_NEG: i64 = 9 |
| 256 | const OP_AND: i64 = 10 |
| 257 | const OP_OR: i64 = 11 |
| 258 | const OP_XOR: i64 = 12 |
| 259 | const OP_SHL: i64 = 13 |
| 260 | const OP_SHR_S: i64 = 14 |
| 261 | const OP_SHR_U: i64 = 15 |
| 262 | const OP_NOT: i64 = 16 |
| 271 | const OP_ROTL64: i64 = 27 |
| 272 | const OP_ROTR64: i64 = 28 |
| 279 | const OP_ADDR_OF: i64 = 29 |
| 287 | const OP_BSWAP64: i64 = 35 |
| 288 | const OP_CLZ32: i64 = 36 |
| 289 | const OP_CTZ32: i64 = 37 |
| 290 | const OP_POPCNT64: i64 = 38 |
| 298 | const OP_ATOMIC_LOAD_I64: i64 = 39 |
| 299 | const OP_ATOMIC_STORE_I64: i64 = 46 |
| 300 | const OP_ATOMIC_CAS_I64: i64 = 47 |
| 301 | const OP_ATOMIC_FAA_I64: i64 = 48 |
| 302 | const OP_ATOMIC_FENCE: i64 = 49 |
| 306 | const OP_THREAD_CLONE: i64 = 64 |
| 307 | const OP_EQ: i64 = 20 |
| 308 | const OP_NE: i64 = 21 |
| 309 | const OP_LT_S: i64 = 22 |
| 310 | const OP_LE_S: i64 = 23 |
| 311 | const OP_GT_S: i64 = 24 |
| 312 | const OP_GE_S: i64 = 25 |
| 313 | const OP_RETURN: i64 = 30 |
| 314 | const OP_BR: i64 = 31 |
| 315 | const OP_BR_COND: i64 = 32 |
| 316 | const OP_CALL: i64 = 33 |
| 317 | const OP_TAIL_CALL: i64 = 34 |
| 322 | const OP_CALL_INDIRECT: i64 = 144 |
| 323 | const OP_COPY: i64 = 40 |
| 324 | const OP_LOAD: i64 = 41 |
| 325 | const OP_STORE: i64 = 42 |
| 326 | const OP_ALLOCA: i64 = 43 |
| 327 | const OP_GEP: i64 = 44 |
| 328 | const OP_SYSCALL: i64 = 45 // ECALL: op0 = syscall number, op1..op6 = args |
| 335 | const OP_FADD: i64 = 50 |
| 336 | const OP_FSUB: i64 = 51 |
| 337 | const OP_FMUL: i64 = 52 |
| 338 | const OP_FDIV: i64 = 53 |
| 339 | const OP_FNEG: i64 = 54 |
| 340 | const OP_FCAST_I_TO_F: i64 = 55 // int -> float |
| 341 | const OP_FCAST_F_TO_I: i64 = 56 // float -> int (truncate) |
| 342 | const OP_F32X4_DOT: i64 = 134 // packed f32x4 dot: (a:*f32[4]) . (b:*f32[4]) -> f32 scalar (x86 SSE movups+mulps+hsum) -- the compute-physics lever |
| 343 | const OP_F32X8_DOT: i64 = 135 // packed f32x8 dot: (a:*f32[8]) . (b:*f32[8]) -> f32 scalar (x86 AVX2 vmovups+vmulps 8-wide + vextractf128 + hsum) -- 2x the SSE lever |
| 344 | const OP_F32X8_FMA: i64 = 136 // (acc:*f32[8]) += (a:*f32[8]) * (b:*f32[8]) FUSED (vfmadd231ps) -- vector accumulate, NO per-chunk hsum |
| 345 | const OP_F32X8_HSUM: i64 = 137 // (acc:*f32[8]) -> f32 horizontal sum (vextractf128 + SSE hsum) -- called ONCE per dot |
| 346 | const OP_I16X16_MADD: i64 = 138 // (acc:*i32[8]) += vpmaddwd((a:*i16[16]),(b:*i16[16])) -- NO-FLOAT integer dot, EXACT + deterministic |
| 347 | const OP_I8DOT32: i64 = 145 // __f32_i8dot32(a:*i8[32], b:*f32[32]) -> f32: dot of 32 sign-extended int8 with 32 f32 (SSE pmovsxbd+cvtdq2ps+mulps+addps, unrolled x8, hsum once). The Q8_0/quantized dequant-dot lever (2026-07-08). |
| 348 | const OP_Q5UNPACK32: i64 = 146 // __q5_unpack32(qhqs:*u8[20], out:*i8[32], consts:*u8[80]) -> 0: SSE unpack of a Q5_0 block (qh[4]+qs[16]) -> 32 signed int8 (nibble|(qh_bit<<4))-16, in A-order. pand/psrlw nibble + pshufb/pcmpeqb qh-bit-spread. Then __f32_i8dot32(out,A)*d = Q5_0 dequant-dot. The 79%-weight lever (2026-07-08). |
| 349 | const OP_I8DOT32A: i64 = 147 // __f32_i8dot32a(a:*i8[32], b:*f32[32]) -> f32: AVX2 256-bit twin of OP_I8DOT32 -- 4 blocks of 8 lanes (vpmovsxbd+vcvtdq2ps+vmulps), TWO accumulators (ymm4/ymm5) to break the serial vaddps chain, combine + one hsum. ~2x the SSE dot. NOT bit-identical to OP_I8DOT32 (different summation order); argmax-robust. The AVX2 dequant-dot lever (2026-07-10, after gcc proved 6x codegen headroom). |
| 350 | const OP_I8FMA32: i64 = 148 // __f32_i8fma32(a:*i8[32], b:*f32[32], d_bits:i64, acc:*f32[8]) -> 0: DEFERRED-HSUM block: acc[8] += d * (sext(a)·b), 8-lane AVX2 vfmadd231ps, NO hsum. The caller keeps a persistent 8-lane acc across all k/32 blocks (broadcasting the per-block scale d) and hsums ONCE per output (__f32x8_hsum) -- kills 27/28 per-block hsums = the cold-forward matmul lever (2026-07-10). 4 operands. |
| 351 | const OP_Q8ROWDOT: i64 = 149 // __f32_q8row_dot(qbuf_row:*u8, a_row:*f32, nblocks:i64) -> f32: MONOLITHIC Q8_0 row dot. Loops all nblocks 34-byte blocks with a REGISTER-resident 8-lane ymm6 accumulator (NO memory round-trip, NO per-block hsum), F16C vcvtph2ps for each block's f16 scale d, vfmadd231ps d*(int8.a), ONE hsum at the end. The real cold-forward matmul lever (2026-07-10) -- kills BOTH the 28 per-block hsums AND the deferred-hsum memory round-trip. 3 operands; internal loop (unique label = fn+rid). |
| 352 | const OP_CRC32: i64 = 139 // __crc32_u64(crc,data): SSE4.2 CRC-32C accumulate (x86 crc32q). Pure; 2 i64 operands, i64 result. |
| 353 | const OP_PDEP: i64 = 140 // __pdep64(src,mask): BMI2 parallel bit DEPOSIT (x86 pdep). Pure; 2 i64 operands, i64 result. |
| 354 | const OP_PEXT: i64 = 141 // __pext64(src,mask): BMI2 parallel bit EXTRACT (x86 pext). Pure; 2 i64 operands, i64 result. |
| 355 | const OP_SHA256_NI_BLOCK: i64 = 142 // hardware SHA-NI: one full SHA-256 block compression IN PLACE. |
| 361 | const OP_MUL256_WIDE: i64 = 143 // __mul256_wide(dst,a,b): fused 4x64-limb schoolbook multiply of the |
| 367 | const OP_FCAST_F32_TO_F64: i64 = 57 |
| 368 | const OP_FCAST_F64_TO_F32: i64 = 58 |
| 369 | const OP_FSQRT: i64 = 150 // scalar float sqrt (sqrtsd/sqrtss); unary, result type = operand float type |
| 370 | const OP_AES128_ENC_BLOCK: i64 = 59 // hardware AES-NI: encrypt 16B block in place (op0=state ptr, op1=roundkeys ptr) |
| 376 | const OP_CLMUL_LL: i64 = 65 |
| 377 | const OP_CLMUL_HH: i64 = 66 |
| 378 | const OP_CLMUL_LH: i64 = 67 |
| 379 | const OP_CLMUL_HL: i64 = 68 |
| 380 | const OP_FEQ: i64 = 60 |
| 381 | const OP_FNE: i64 = 61 |
| 382 | const OP_FLT: i64 = 62 |
| 383 | const OP_FLE: i64 = 63 |
| 418 | const OP_VADD: i64 = 80 // element-wise add |
| 419 | const OP_VSUB: i64 = 81 |
| 420 | const OP_VMUL: i64 = 82 |
| 421 | const OP_VDIV: i64 = 83 // signed int / float |
| 422 | const OP_VFADD: i64 = 84 // fp variant (vfadd.vv) |
| 423 | const OP_VFSUB: i64 = 85 |
| 424 | const OP_VFMUL: i64 = 86 |
| 425 | const OP_VFDIV: i64 = 87 |
| 426 | const OP_VLE: i64 = 88 // vector load element (vle32.v / vle64.v) |
| 427 | const OP_VSE: i64 = 89 // vector store element |
| 428 | const OP_VSETVLI: i64 = 90 // explicit vl/vtype setup |
| 429 | const OP_VMV_S_X: i64 = 91 // scalar broadcast into vector |
| 430 | const OP_VREDSUM: i64 = 92 // reduction sum (for softmax denom, norm) |
| 436 | const OP_SIMD_VDOT_I16_X16: i64 = 93 // (a:i16x16) . (b:i16x16) -> i64 scalar |
| 441 | const OP_SIMD_VREDUCE_MIN_I16_X16: i64 = 94 // (v:*i64) -> i64 sign-ext min |
| 442 | const OP_SIMD_VREDUCE_MAX_I16_X16: i64 = 95 // (v:*i64) -> i64 sign-ext max |
| 445 | const OP_SIMD_VSADD_I16_X16: i64 = 96 // (a:*i64, b:*i64, out:*i64) -> void |
| 447 | const OP_SIMD_VSSUB_I16_X16: i64 = 97 |
| 450 | const OP_SIMD_VSADDU_I16_X16: i64 = 98 |
| 451 | const OP_SIMD_VSSUBU_I16_X16: i64 = 99 |
| 454 | const OP_SIMD_VMIN_LANE_I16_X16: i64 = 100 |
| 455 | const OP_SIMD_VMAX_LANE_I16_X16: i64 = 101 |
| 456 | const OP_SIMD_VADD_LANE_I16_X16: i64 = 102 |
| 457 | const OP_SIMD_VSUB_LANE_I16_X16: i64 = 103 |
| 458 | const OP_SIMD_VMUL_LANE_I16_X16: i64 = 104 |
| 464 | const OP_SIMD_VSLL_I16_X16: i64 = 105 |
| 465 | const OP_SIMD_VSRL_I16_X16: i64 = 106 |
| 466 | const OP_SIMD_VSRA_I16_X16: i64 = 107 |
| 472 | const OP_SIMD_VREDUCE_SUM_I16_X16: i64 = 108 |
| 475 | const OP_SIMD_VBROADCAST_I16_X16: i64 = 109 |
| 480 | const OP_SIMD_VADD_I8_X32: i64 = 110 |
| 481 | const OP_SIMD_VSUB_I8_X32: i64 = 111 |
| 482 | const OP_SIMD_VSADD_I8_X32: i64 = 112 // signed saturating |
| 483 | const OP_SIMD_VSSUB_I8_X32: i64 = 113 // signed saturating |
| 487 | const OP_SIMD_VREDUCE_SUM_I8_X32: i64 = 114 |
| 490 | const OP_SIMD_VBROADCAST_I8_X32: i64 = 115 |
| 495 | const OP_SIMD_VADD_I32_X8: i64 = 116 |
| 496 | const OP_SIMD_VSUB_I32_X8: i64 = 117 |
| 497 | const OP_SIMD_VMUL_I32_X8: i64 = 118 |
| 498 | const OP_SIMD_VSADD_I32_X8: i64 = 119 |
| 499 | const OP_SIMD_VSSUB_I32_X8: i64 = 120 |
| 503 | const OP_SIMD_VREDUCE_SUM_I32_X8: i64 = 121 |
| 506 | const OP_SIMD_VBROADCAST_I32_X8: i64 = 122 |
| 508 | const OP_SIMD_VADD_I64_X4: i64 = 123 |
| 509 | const OP_SIMD_VSUB_I64_X4: i64 = 124 |
| 510 | const OP_SIMD_VMUL_I64_X4: i64 = 125 |
| 511 | const OP_SIMD_VSADD_I64_X4: i64 = 126 |
| 512 | const OP_SIMD_VSSUB_I64_X4: i64 = 127 |
| 513 | const OP_SIMD_VREDUCE_SUM_I64_X4: i64 = 128 |
| 514 | const OP_SIMD_VBROADCAST_I64_X4: i64 = 129 |
| 520 | const OP_RDTSC: i64 = 130 |
| 521 | const OP_UMULHI: i64 = 131 // unsigned 64x64 -> high 64 bits (x86 mulq); G2 wide-multiply |
| 522 | const OP_ADC_ACC: i64 = 132 // G3 native add-with-carry: (hi:lo) += into a 3-word *acc (addq;adcq;adcq) |
| 525 | const OP_CPUID_EBX: i64 = 133 // x86 cpuid(leaf=op0, subleaf=op1) -> EBX (feature register). For the |
| 528 | const OP_WFI: i64 = 70 |
| 529 | const OP_CSR_READ: i64 = 71 |
| 530 | const OP_CSR_WRITE: i64 = 72 |
| 531 | const OP_FENCE: i64 = 73 |
| 532 | const OP_MRET: i64 = 74 |
| 536 | const VK_CONST_INT: i64 = 0 |
| 537 | const VK_PARAM: i64 = 1 |
| 538 | const VK_INSTR: i64 = 2 |
| 543 | const VK_GLOBAL: i64 = 3 |
| 546 | const VK_FUNC_ADDR: i64 = 4 |
| 553 | const TY_VOID: i64 = 0 |
| 554 | const TY_BOOL: i64 = 1 |
| 555 | const TY_I8: i64 = 2 |
| 556 | const TY_I16: i64 = 3 |
| 557 | const TY_I32: i64 = 4 |
| 558 | const TY_I64: i64 = 5 |
| 559 | const TY_PTR: i64 = 6 |
| 560 | const TY_STRUCT: i64 = 7 |
| 561 | const TY_PARAM: i64 = 8 // generic type variable (T, E) inside a template |
| 565 | const TY_F32: i64 = 9 // single precision (RV64F) |
| 566 | const TY_F64: i64 = 10 // double precision (RV64D) |
| 571 | const TY_ARRAY: i64 = 11 |
| 575 | const TY_FUNC: i64 = 12 |
| 595 | const TY_SLICE: i64 = 13 |
| 596 | const NX_SLICE_HDR_BYTES: i64 = 16 // {data, len} |
| 597 | const NX_SLICE_LEN_OFFSET: i64 = 8 // byte offset of len within the header |
| 601 | const VL_REGISTER: i64 = 0 |
| 602 | const VL_SPILLED: i64 = 1 |
| 607 | const VL_REMAT: i64 = 2 |
| 615 | const VL_ALLOCA: i64 = 3 |
| 619 | const VAL_CONST: i64 = 0 |
| 620 | const VAL_PARAM: i64 = 1 |
| 621 | const VAL_INSTR: i64 = 2 |
functions
| none |