Does AMOMAXU.H return the post-operation value?
No. Like A-extension AMOs, rd receives the old value loaded from memory.
Atomic halfword unsigned max: rd = *rs1 (zero-ext), *rs1 = umax(*rs1, rs2[15:0])
AMOMAXU.H (Zabha extension) atomically loads a halfword from the address in rs1 into rd (zero-extended), compares with the low 16 bits of rs2, stores unsigned maximum back. Supports aq/rl bits.
AMOMAXU.H is a Zabha 16-bit unsigned atomic maximum instruction. It atomically reads the old memory value, performs the read-modify-write at 16-bit width, and writes the sign-extended old value to rd.
Understand this scenario with real code like «amomaxu.h a0, a2, (a1)».
Understand this scenario with real code like «amomaxu.h a0, a2, (a1)».
No. Like A-extension AMOs, rd receives the old value loaded from memory.
Architecturally it modifies only the halfword operand; Zabha provides native halfword-granule atomic read-modify-write operations.