lr.d
Load reserved (double word)
Loads the double word at the address in the second register into the first and reserves that address for a following sc.d.
Forms
lr.d , ()
Operands
t1- Any integer register,
x0tox31, or its named alias, such aszero,t0ort6. t2- An integer register. It may be the same register as
t1.
Pair with sc.d to build an atomic read-modify-write that can be retried
This example runs on RV64.
# value is initialized and naturally aligned for this operation.
.data
value: .dword 0x0000000012345678
.text
la t0, value
# Reserve the aligned doubleword at value; t2 receives 305419896.
lr.d t2, (t0)