Files
Odin/core/rexcode/isa
Brendan Punsky b1fb9be5c9 rexcode/arm32: the halfword and dual load/stores, checked against llvm-mc
arm32 had only ever been checked against itself. Its sweep round-trips
our own encode and decode, which agree with each other whether or not
either is right -- exactly how the arm64 bugs stayed hidden for months.
Decoding each entry and handing the text to llvm-mc says something
different: 683 of 1139 A32 entries byte-exact, 166 wrong, 290 that no
assembler would take.

Three real faults out of that first pass:

  - The halfword and dual load/stores split their 8-bit offset around
    the opcode at bits 7:4, and their pre/post-indexed forms were using
    the 12-bit decoder. It swallowed the opcode nibble, so `strht r0,
    [r0]` came back as `[r0], #-176` -- 0xb0 being the halfword opcode
    read as an offset. 16 forms.

  - LDRD and STRD name a register pair and we printed one half of it.
    The second is always the first plus one and occupies no bits, so it
    needed an encoding that reads Rt and adds one.

  - An indexed form printed no displacement when it was zero, which
    turns `[r0], #0` into `[r0]` -- a different instruction, since the
    writeback is the whole point of the form.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018UmHLRF11EoWwNWCJ7JGaA
2026-08-28 19:58:06 -04:00
..
2026-08-18 18:23:42 +01:00