ldaxrb

Load-Acquire Exclusive Register Byte

LDAXRB <Wt>, [<Xn|SP>]

Loads a byte with Acquire Exclusive semantics.

Details

Load-Acquire Exclusive Register Byte loads an 8-bit byte from memory with both Acquire and Exclusive semantics, establishing a one-way memory barrier and reserving the addressed location for exclusive write tracking. The instruction is AArch64-only, does not modify condition flags, and the loaded byte is zero-extended to 32 bits. This instruction must be paired with a store exclusive to complete atomic byte transactions.

Pseudocode Operation

Wt ← ZeroExtend(Mem8[Xn], 8)
ExclusiveMonitor[Xn] ← LOCKED
# Acquire semantics: subsequent memory operations appear after this load

Example

LDAXRB w3, [x1]

Encoding

Binary Layout
00
0010000
1
0
11111
1
11111
Rn
Rt
 
Format Load/Store Excl
Opcode 0x085FFC00
Extension Base (Atomic)

Operands

  • Wt
    Transfer 32-bit integer register (load/store)
  • Xn
    First source / base 64-bit integer register

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x085FFC00 LDAXRB <Wt>, [<Xn|SP>{, #0}] A64 00 | 0010000 | 1 | 0 | 11111 | 1 | 11111 | Rn | Rt

Description

Load-Acquire Exclusive Register Byte derives an address from a base register value, loads a byte from memory, zero-extends it and writes it to a register. The memory access is atomic. The PE marks the physical address being accessed as an exclusive access. This exclusive access mark is checked by Store Exclusive instructions. See Synchronization and semaphores. The instruction also has memory ordering semantics as described in Load-Acquire, Store-Release. For information about memory accesses, see Load/Store addressing modes.

Operation

bits(64) address;
bits(8) data;

AccessDescriptor accdesc = CreateAccDescExLDST(MemOp_LOAD, TRUE, tagchecked);

if n == 31 then
    CheckSPAlignment();
    address = SP[];
else
    address = X[n, 64];

// Tell the Exclusives monitors to record a sequence of one or more atomic
// memory reads from virtual address range [address, address+dbytes-1].
// The Exclusives monitor will only be set if all the reads are from the
// same dbytes-aligned physical address, to allow for the possibility of
// an atomicity break if the translation is changed between reads.
AArch64.SetExclusiveMonitors(address, 1);

data = Mem[address, 1, accdesc];
X[t, 32] = ZeroExtend(data, 32);