Closed
Labels
enhancementNew feature or request
Description
get_result in Pattern.hpp only decodes B/BL, ADR/ADRP (+ ADD and LDR/LDRH/STR followers), lone LDR/LDRH/STR offsets, MOVZ and ADD/SUB. With X on anything else, find() throws std::logic_error("Failed to decode instruction with defined functions").
- Branch targets:
X B.EQ #?,X CBZ X0, #?,X CBNZ ...(imm19), andTBZ/TBNZ(imm14) once those are encoded. - ADRP followers:
ADRP X8, ...+LDRB/LDRSW/STRB/STRH/LDUR[X8,#lo](byte/flag globals are very common). Today only LDR/LDRH/STR end the ADRP chain with their offset. - Lone-offset values for the same forms.
- While there:
saved_offset += (offset < 0 ? -offset : offset)adds the absolute value of a negative (pre/post-index) offset; check whether that's intended.
Tests: deref_synthetic (everywhere) and deref_relocated (Apple arm64) in tests/test_arm.cpp.
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
scizzydo commentedon Oct 12, 2026
Addressed in #12. Most of this had already landed in #4; this PR finishes it:
a64_decode_branch_imm.a64_decode_load_store(covered inderef_synthetic). Added: FP/SIMD loads (LDR D0/Q1,LDUR S2with Q scaled by 16), plus FP literal loads.saved_offset: the code already adds the signed offset (saved_offset += offset), so negative pre-index offsets subtract; covered by theLDR X0, [X8,#-8]!follower test.🤖 Generated with Claude Code