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

The ldarx instruction loads a doubleword from memory into register RT. It also reserves the memory location for use by a subsequent stdcx. or waitrsv instruction.

Pseudocode Operation

if RA = 0 then
    b ← 0
else
    b ← (RA)
EA ← b + (RB)
RESERVE ← 1
RESERVE_LENGTH ← 8
RESERVE_ADDR ← real_addr(EA)
RT ← MEM(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

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