Does AMOMAXU.H zero-extend rd?
No. Zabha AMO.H sign-extends the old value into rd; the U in AMOMINU.H/AMOMAXU.H only means unsigned comparison.
AMOMAXU.H atomically reads the old halfword, sign-extends it into rd, and compares the old halfword and rs2[15:0] as unsigned 16-bit values and writes the larger value.
AMOMAXU.H is a halfword AMO from the Zabha byte and halfword atomic-memory-operation extension. It performs a 16-bit read-modify-write, writes the sign-extended old memory halfword to rd, and compares the old halfword and rs2[15:0] as unsigned 16-bit values and writes the larger value. The aq/rl bits annotate memory ordering and do not change the data computation.
Shows Zabha halfword atomic field decode, aq/rl ordering bits, memory read, and RMW state update.
Zabha-extension halfword atomic instructions use a 32-bit encoding; the animation starts by splitting the fields.
AMOMAXU.H selects the memory writeback halfword using a unsigned 16-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.
AMOMAXU.H is an L5 Zabha halfword AMO: it atomically reads the old 16-bit memory value, sign-extends that old value into rd, and compares the old halfword and rs2[15:0] as unsigned 16-bit values and writes the larger value.
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. Zabha AMO.H sign-extends the old value into rd; the U in AMOMINU.H/AMOMAXU.H only means unsigned comparison.
Architecturally it modifies only the target 16-bit halfword and computes the new memory value at halfword width; neighboring bytes are not part of that data result.