ldarx

Load Doubleword and Reserve Indexed

ldarx RT,RA,RB,EH
ldarx RT,RA,RB

Loads a doubleword and creates a reservation. 64-bit version of lwarx.

Details

Loads a doubleword from memory at address RA+RB and creates a reservation on that memory location for use with subsequent stdcx. instructions. The EH field provides a hint to the processor about the expected outcome of the following store-conditional. This is the 64-bit variant of lwarx and is essential for atomic operations and synchronization primitives.

Pseudocode Operation

EA ← (RA) + (RB)
RT ← MEM(EA, 8)
Reserve(EA, 8)

Programming Note

Load Doubleword And Reserve Indexed X-form serves as both a basic and an extended mnemonic. The Assembler will recognize a ldarx mnemonic with four operands as the basic form, and a ldarx mnemonic with three operands as the extended form.

Extended Mnemonics

Extended Mnemonic Equivalent Instruction
ldarx

Example

ldarx r3, 0, r4

// Atomic 64-bit load.

Encoding

Binary Layout
31
0
RT
6
RA
11
RB
16
84
21
/
 
Format X-form
Opcode 0x7C0000A8
Extension Base
Registers Altered RESERVE, RESERVE_LENGTH, RESERVE_ADDR

Operands

  • RT
    Target Register
  • RA
    Base Register
  • RB
    Index Register
  • EH
    Hint for subsequent store operation