0x0LearnReferenceLibraries0x0.jmp0x1b.com

Native IR And Machine Model

Native IR is the verified low-level contract for 0x0 native performance work.

It sits after typed/effect checking and before machine-code emission, object

emission, linker input generation, or freestanding firmware image production.

The authoritative machine-readable files are:

and deferred vector shapes;

relocation model, code model, and target features;

MMIO, alias, and lifetime rules;

lowering invariants;

Position In The Pipeline

Native IR is not source syntax. It is a compiler-owned artifact derived from

typed/effect IR or an audited equivalent typed lowering. Backends may consume

native IR directly, or a backend may consume an audited lowering from native IR

when that backend has explicit evidence.

The invariant is simple: once native IR verifies, native backends get a single

typed machine model for blocks, values, calls, memory operations, control flow,

static data, traps, source spans, effects, and target features.

Machine Model

The first target rows are:

zero-x86_64-sysv-v0.1 ABI;

zero-freestanding-v1 ABI and QEMU-or-equivalent emulator requirement.

Every target row names:

Memory And Volatile Rules

Pointers use concrete address spaces, for example ptr[stack,i64],

ptr[heap,i64], or ptr[mmio,i32].

The verifier rejects pointer casts that change address spaces unless a target

rule explicitly allows the cast. No current target allows generic memory to be

cast into MMIO.

Volatile MMIO operations must:

Optimizers must not delete, duplicate, merge, split, speculate, or reorder

volatile operations relative to other volatile operations.

Verifier

Run:


make native-ir-check

This bounded gate validates the schema files and fixtures. It does not run

native code generation, self-hosting, release packaging, emulator matrices, or

benchmark matrices.

Stable verifier diagnostics include:

terminator, or instruction after terminator;

return mismatch;

Current Boundary

Milestone 1 defines and verifies the contract. Later milestones implement

freestanding runtime profiles, monomorphization, strictness analysis, inlining,

tail calls, native machine code generation, tiny binaries, hardware access, and

release benchmark evidence.