amomax.d

Atomic signed maximum double word (64-bit) RV64 only

Loads the double word at the address in t3 into t1 and stores the larger of it and t2 there, compared as signed, atomically (RV64 only).

RISC-V manual: amomax.d

Forms

  • amomax.d , , ()

Operands

t1
Any integer register, x0 to x31, or its named alias, such as zero, t0 or t6.
t2
An integer register. It may be the same register as t1.
t3
An integer register. It may be the same register as t1.

This example runs on RV64.

# value is initialized and naturally aligned for this operation.
.data
value: .dword 0x0000000012345678
.text
la t0, value
# Atomic operation returns the old value 305419896 in t2, then changes value to 305419896.
li t1, 5
amomax.d t2, t1, (t0)