AArch64 / ARM64 (archsem-arm64)

archsem-arm64 provides the AArch64 architecture manifest (ARM64_MANIFEST), register map (regmap), semantic table (ARM64_SEMANTICS), Asem-generated instruction programs, and—behind the farm64 feature—the fARM64 decoder adapter and form catalogs.

# Pure data only:
archsem-arm64 = "0.1"

# With fARM64 decoder adapter:
archsem-arm64 = { version = "0.1", features = ["farm64"] }

Execution Mode & NZCV Carry Polarity

ARM64_MANIFEST declares a single 64-bit execution mode (A64, flat little-endian 64-bit addressing, pc_read_bias = 0).

Register Model & CarryPolarity::BorrowClear

  • GPRs (0..32): X0–X30 (X30 = LR) plus dedicated SP (cid = 31). Writing Wn (32 bits) uses SubRegMap::ArmLowHalf (ZeroExtendParent into Xn). XZR/WZR (cid = 32) is a sentinel outside the GPR bank that reads as imm(0) and ignores writes.
  • NZCV Flags (0x80..0x83) & Inverted Carry Polarity: ARM64_MANIFEST sets carry_polarity: CarryPolarity::BorrowClear. Unlike x86 (where SUB sets CF on borrow, ULt), ARM64 SUBS sets C on no-borrow (UGe). The shared flag engine (emit_flags) and Asem flags recipes derive both polarities automatically from the manifest.

Farm64Decoder (farm64 Feature)

Farm64Decoder (Decoder<Insn = FarmInsn, State = NoDecodeState>) wraps fARM64 and enforces canonical EnabledFeatures gating (neon, fp, lse):

  • Pure Branches (B, B.cond, BC.cond, CBZ, CBNZ, TBZ, TBNZ): Classified by FlowClass rather than carrying a SemProgram. conditional_branch_metadata(&Instruction) extracts exact ConditionalBranchPredicate (Flags(Cond), Zero, or Bit) plus resolved taken and fallthrough addresses so the generic CFG driver never guesses branch conditions.
  • Pre/Post-Indexed Memory & Pairs (LDR/STR/LDP/STP): Emit all memory accesses before base writeback (Writeback::Pre / Post) so faults preserve architectural register state.
  • Decoder Extensions (decoder_extensions): Covers exact published instruction words (such as ZT0 LDR/STR and LDAP1/STL1 forms) alongside the core fARM64 catalog.

FP/SIMD, SVE/SME Scalable State, and Extensions

Extension FamilyStorage & Semantic Modeling
AdvSIMD & FPV0–V31 (VEC_BASE = 0x100, SubRegMap::VectorNested) share the low 128 bits of Z0–Z31. Writes to V registers under SVE use an Asem write_hook (vector_overlap) to zero or preserve active Z bits above bit 127 according to CurrentVL and the constrained-unpredictable choice. FPCR, FPSR, and FPMR (0x200..0x202) track rounding, controls, and cumulative exceptions.
SVE / SVE2 / SVE2p3Z0–Z31 (2048-bit storage), P0–P15 (256-bit predicates, 0x300+n), and FFR (256-bit, 0x310). Runtime VL supports 128–2048 bits in 128-bit increments (including non-powers-of-two). Scalable memory instructions model first-fault/non-fault FFR progress and guest-resolved permissions.
SME / SME2 / SME2p3ZA matrix (256 rows of 2048 bits, 0x400+row), ZT0 (512-bit lookup table, 0x500), PSTATE.SM (0x501), PSTATE.ZA (0x502), and LUTI6 / outer-product / tile operations.
FP16 / BF16 / FP8Typed lane formats and integer-only fp_values::fp8_dot_add (E5M2/E4M3) primitives without host FPU dependence.
PAC (PAuth) & PSTATE.PACMQARMA3/5 integer rounds, pointer-tag insertion/authentication, explicit faults, and PSTATE.PACM (0x503) with guest-supplied keys and VA/TBI/MTX masks.
MTE (Memory Tagging)Tag arithmetic/packing, RGSR seed/tag (0x680..0x681), and allocation-tag vendor space (0xA64).
MOPS, LS64, RCW/RCWS, FEAT_LOR, UnprivilegedOrdered copy/set/tag stages with deferred abort delivery (MOPS); single-copy 512-bit LD64B/ST64B* (LS64); lease-scoped RCW/RCWS (guest_atomicity); AcquirePerLocation (RCpc); *_LimitedRegion (FEAT_LOR); and unprivileged (LDTR/STTR) memory policies.
Apple AMX & GXFExplicit M1–M4 AMX X/Y/Z (0x600+n, 0x608+n, 0x620+n) matrix storage and integer/FP kernels (AMX_ENABLED 0x660), plus GXF (TINDEX/SAVED_TINDEX/TENTER_RETURN 0x670..0x672) with vendor guest callbacks.

Executable Guest Bindings (archsem-ref/arm64-guest)

When running AArch64 semantics concretely in archsem-ref (with features = ["arm64-guest"]), ConcreteEnvironment::with_arm64_bindings and with_arm64_services provide exact integer IEEE FP arithmetic/status traces, effective VL/SVL feature access checks, and byte-level MOPS, MTE, single-agent RCW/LSFE, LS64, and TIndex policies—while keeping OS exception routing, address translation, and multi-agent locking as explicit caller contracts.