mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-20 09:02:32 +00:00
Each ISA's hand-written ENCODING_TABLE (the single source of truth) now lives in a per-arch tablegen/ metaprogram that flattens it and serializes committed binary blobs; the library #loads those into @(rodata) at compile time rather than compiling a table body. No arch keeps encoding_table.odin or decoding_tables.odin -- only a generated tables.odin loader and tables/*.bin. * Two-stage, type-checked pipeline: tablegen Stage A emits human-readable generated Odin, which compiles and serializes the blobs in Stage B. * encode() goes through encoding_forms(m); decoders are unchanged apart from x86's flattened 2-D index. Decode tables are byte-identical to the old ones. * build.lua: a LuaJIT driver for the metaprograms, validations, and tests, with cross-platform gating and a clear report. * Docs refreshed; the obsolete forward-looking plan in cross_arch_design.md trimmed to what was actually built. * Attribution headers added to all rexcode source files; the generators emit them so generated files keep them.
22 lines
857 B
Odin
22 lines
857 B
Odin
// rexcode · Brendan Punsky (dotbmp@github), original author
|
|
|
|
package rexcode_x86
|
|
|
|
// =============================================================================
|
|
// x86 LABELS
|
|
// =============================================================================
|
|
//
|
|
// Type aliases to the array-index label model in `isa/labels.odin`, so
|
|
// callers can construct values like `x86.Label_Definition(3)` without
|
|
// importing `isa`. The label-construction procedures themselves
|
|
// (`label`, `label_forward`, `label_set_at`, `label_named`,
|
|
// `label_reserve`, `label_set`, `label_map_init/destroy`) are parametric
|
|
// over the Instruction type and live in `isa/labels.odin` -- callers
|
|
// invoke them directly as `isa.<proc>(...)`.
|
|
|
|
import "../isa"
|
|
|
|
Label_Definition :: isa.Label_Definition
|
|
Label_Map :: isa.Label_Map
|
|
LABEL_UNDEFINED :: isa.LABEL_UNDEFINED
|