You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
t27a: mnemonic table and strict decoder for the 47 TRI-27 opcodes (sieve, T736) #6516
A disassembler user must be told when a byte is not an opcode. Today decode_opcode in specs/isa/ternary_encoding.t27 maps the 209 undefined bytes to NOP, so garbage reads as NOP.
Requirements
New module T27aMnemonics in specs/isa/t27a_mnemonics.t27, with use isa::ternary_encoding;.
pub fn opcode_at(i: u32) -> u32 gives the opcode byte of table index 0..46 in the order of OPCODE_VALUES, and 256 for any other index. Write it as if chains, not array indexing.
pub fn index_of(op: u32) -> u32 is its inverse, and gives 47 for an undefined byte.
pub fn strict_decode(byte: u32) -> u32 returns the byte for a defined opcode and 256 (invalid) otherwise.
Tests that call these functions at run time:
index_of(opcode_at(i)) == i for every i in 0..46;
exactly 47 bytes in 0..255 have strict_decode(b) != 256;
exactly 209 bytes are rejected;
a negative control showing decode_opcode maps byte 1 to NOP while strict_decode(1) == 256.
Do not copy any function body from specs/isa/ternary_encoding.t27 or specs/compiler/theory/isa_round_trip.t27. The dupe ratchet rejects copied bodies; call them through use instead.
Lines start with ; for prose (never a bare ;), ASCII only, English identifiers.
The PR contains only .t27 and t27c-generated files (owner hard rule 2026-10-05).
The PR says Closes #<this issue> and Refs #6488.
Success Criteria
t27c typecheck specs/isa/t27a_mnemonics.t27 prints Typecheck OK (0 errors.
Activity
feat(isa): t27a mnemonic table and strict decoder for 47 TRI-27 opcod…
feat(isa): t27a MVP -- TRI-27 assembler/disassembler round-trip (Refs #…