Regenerate interpreter dispatch tables
The interpreter's tables are GENERATED from the disassembler's lookup tables so interpreter-decode can never disagree with jit-decode. Never edit the generated files by hand.
| table | source of truth | generator |
|---|---|---|
src/jit/interpreter/thumb_table.rs ([ThumbInterpFn; 1024], indexed op >> 6) |
src/jit/disassembler/thumb/lookup_table_thumb.rs |
tools/gen_thumb_table.py |
src/jit/interpreter/arm_table.rs ([ArmInterpFn; 4096], indexed ((op>>16)&0xFF0)|((op>>4)&0xF)) |
src/jit/disassembler/lookup_table.rs |
same approach: parse the table paren-depth-aware, map each slot's disassembler fn name to the interpreter handler, unknown → inst_fallback |
Workflow:
- Add the specialized handler(s) in
src/jit/interpreter/(const generics +paste, mirroringdisassembler/delegations.rs— no matching on the execution path; see DEVELOPMENT.md §2 for the design rules). - If the handler stays unimplemented in the interpreter, keep its name in the generator's
FALLBACK set so the slot maps to
inst_fallback/inst_fallback_t(fallback = the block compiles instead; correctness holds at any coverage). - Run the generator from the repo root:
python3 tools/gen_thumb_table.py. - Build; the table references handlers by bare name, so a missing/renamed handler fails loudly at compile time.
- Verify semantics against the jit with an A/B trace (inst-trace skill) if the change is more than mechanical.