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
ArmPattern /d: decode B.cond, CBZ/CBNZ and the new load/store forms #11
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), and TBZ/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.
Addressed in #12. Most of this had already landed in #4; this PR finishes it:
Branch targets: B.cond, CBZ/CBNZ and literal LDR were already decoded; TBZ/TBNZ (imm14) are added. The decoder is renamed a64_decode_branch_imm.
ADRP followers: LDRB/LDRSW/STRB/STRH/LDUR were already handled by a64_decode_load_store (covered in deref_synthetic). Added: FP/SIMD loads (LDR D0/Q1, LDUR S2 with Q scaled by 16), plus FP literal loads.
Lone-offset values: the same decoder, so it covers the same forms.
saved_offset: the code already adds the signed offset (saved_offset += offset), so negative pre-index offsets subtract; covered by the LDR X0, [X8,#-8]! follower test.
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