amomin.w

Atomic signed minimum word (32-bit)

Loads the word at the address in t3 into t1 and stores the smaller of it and t2 back there, compared as signed, atomically.

RISC-V manual: amomin.w

Forms

  • amomin.w , , ()

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.
# value is initialized and naturally aligned for this operation.
.data
value: .word 0x12345678
.text
la t0, value
# Atomic operation returns the old value 305419896 in t2, then changes value to 5.
li t1, 5
amomin.w t2, t1, (t0)