Skip to content

ArmPattern: floating-point/SIMD loads, stores and FMOV #7

Closed

Description

@scizzydo

LDR/STR/LDUR/STUR/LDP/STP only take W/X registers. With B/H/S/D/Q registers the line is a wildcard (mask 0, so the IDA plugin warns); before the scanner-overhaul branch they were silently encoded as integer loads and never matched.

Common in practice: STP D9, D8, [SP,#-0x20]! / LDP D9, D8, ... in prologues and epilogues, LDP Q0, Q1, [X1] / STP Q0, Q1, ... struct copies, LDR S0, [X0,#8] float members.

  • Single-register forms: V bit 26 set; size + opc bit 23 select B/H/S/D/Q (Q: size 00, opc 1x); the unsigned offset is scaled by the access size. Extend parse_load_store in ArmPattern.hpp.
  • Pairs: opc 00 S / 01 D / 10 Q with V = 1; imm7 scaled by 4/8/16. Extend parse_ldp.
  • FMOV (register, general-purpose to/from FP, and the 8-bit immediate form).
  • Literal LDR S0/D0/Q0, #offset.

🤖 Generated with Claude Code

Activity

  1. scizzydo commented on Oct 12, 2026

    @scizzydo
    OwnerAuthor

    Addressed in #12:

    • LDR/STR/LDUR/STUR with B/H/S/D/Q registers: V (bit 26), size and opc bit 23 (Q) come from Rt, and the offset is scaled by the access size (pre/post-index and register-offset forms included).
    • LDP/STP (and LDNP/STNP) with S/D/Q, imm7 scaled by 4/8/16.
    • Literal LDR S/D/Q, #offset.
    • FMOV: register, general-purpose to/from FP (S/W, D/X, H/W/X), and immediates such as #1.0, #-2.5, #0.125 (all 256 imm8 values compared exactly). #0.0 encodes as FMOV from the zero register; a value that isn't representable gives mask 0.
    • Wildcards: a bare ? load/store register still means W or X (it would otherwise also match LDRB/LDRSB); use D?, Q?, etc. for FP registers.
    • /d: FP loads after ADRP (ADRP X8 + LDR D0, [X8,#lo]) and FP literal loads resolve.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions