Does AMOMAX.B return the post-operation value?
No. Like A-extension AMOs, rd receives the old value loaded from memory.
Atomic byte signed max: rd = *rs1 (sign-ext), *rs1 = max(*rs1, rs2[7:0])
AMOMAX.B is a Zabha instruction, for which Zabha depends on Zaamo. It atomically loads a byte from the address in rs1 into rd (sign-extended), compares with the low byte of rs2, stores signed maximum back, and supports aq/rl bits.
Shows Zabha (requires Zaamo) byte atomic field decode, aq/rl ordering bits, a memory read, and RMW state update.
Zabha depends on Zaamo; Zabha-extension byte atomic instructions use a 32-bit encoding; the animation starts by splitting the fields.
AMOMAX.B selects the memory writeback byte using a signed 8-bit comparison; this is not a per-bit logical operation.
This animation shows ISA-visible atomic read-modify-write, compare-and-swap, LR/SC reservation state, and ordering bits, not any specific CPU cache-coherence implementation, pipeline, or timing.
AMOMAX.B is a Zabha 8-bit signed atomic maximum instruction. It atomically reads the old memory value, performs the read-modify-write at 8-bit width, and writes the sign-extended old value to rd.
Understand this scenario with real code like «amomax.b a0, a2, (a1)».
Understand this scenario with real code like «amomax.b a0, a2, (a1)».
No. Like A-extension AMOs, rd receives the old value loaded from memory.
Architecturally it modifies only the byte operand; Zabha provides native byte-granule atomic read-modify-write operations.