Repository navigation
Encode the remaining arm64 instructions with full wildcard support - #12
Merged
Merged
Conversation
TBZ/TBNZ and exceptions, BTI and pointer authentication, FP/SIMD loads, stores and FMOV, signed/exclusive/acquire-release loads and LSE atomics, bitfield/shift/extend aliases, conditional select/compare, multiply/divide and the inverted-operand logical forms. /d now resolves TBZ/TBNZ, FP literal loads and FP loads after ADRP. A "?" shift or extend type now leaves the type open instead of pinning LSL. The mnemonic buffer grows to 15 chars (LDADDALB). Wildcard rules are documented in docs/arm64.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 12, 2026
… loads - A "?" extend in a register-offset load/store ([X1, X2, ?], ? #3) pinned LSL with the wrong S bit, so the pattern could never match. It now leaves the extend (and the amount unless one is given) open. - A bare "?" Rt with a known offset picked the scaled form from neither width, missing the LDUR the assembler emits (LDR ?, [X1,#0x81]) or the only width that fits (#0x4000 is X only). W and X are now both encoded and merged, like the bitfield aliases (shared either() helper). - /d: a load into an FP register or a store between ADRP and its use no longer ends the chain as if it overwrote the ADRP register. - docs: #? in LDR is the scaled form, FMOV #? doesn't cover #0.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5, closes #6, closes #7, closes #8, closes #9, closes #10, closes #11
Summary
/d(get_result):Wildcard rules (in
docs/arm64.md): a?opens exactly the bits its operand decides. Fields computed from a?are open too. A bare?register leaves the width open. With unknown width, both 32 and 64-bit encodings are computed and only the bits they share stay pinned. An operand that can't be encoded makes the line mask 0, never a pattern that can't match. A bare?load/store register means W or X; FP registers useD?/Q?.Evidence
test_arm: 151 exact-encoding rows, 127 wildcard rows. Every new form was a mask-0 wildcard.After: 409 exact-encoding rows, 291 wildcard rows (each wildcard field has one match and one near miss), 33 unencodable forms that must give mask 0, plus new
/dcases. All encodings were generated with llvm-mc. On Apple arm64 (mac-mini),assembler_agreesre-assembles every row:tables match the assembler ok.?), before vs after. Only 13 differ, all?used as a shift type (ORR X0, X1, X2, ?#3): it used to pin LSL and now leaves the type open.test_arm,test_patterns(with and without SIMD),test_cpp17pass. The IDA plugin builds and its test passes.Merge Danger
Door: two-way
Header-only; reverting the commit restores the old encoder.
Blast Radius: encoder
?as a shift or extend type now matches any shift type instead of only LSL.test_armare the thing to watch in Windows CI.🤖 Generated with Claude Code