Does AMOMINU.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.
AMOMINU.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 smaller value.
Syntax is rd, rs2, (rs1). The three fields select x0–x31 or ABI names, with no offset immediate or rs3.
funct5=11000, funct3=001, opcode=0101111; aq at bit26 and rl at bit25 are independent ordering bits.
RV32/RV64 Zabha (requires Zaamo): rd receives the sign-extended old 16-bit memory value; only the low 16 rs2 bits compute new memory.
The region must support this AMO width and operation. Use two-byte alignment, or a PMA with all accessed bytes in one misaligned atomicity granule; otherwise misalignment raises address-misaligned or access-fault.
Sources use pre-execution values; rd=x0 discards register writeback while memory read-modify-write still occurs. aq/rl orders only the accessed memory/I/O domain.
AMOMINU.H is a halfword AMO from Zabha, which depends on Zaamo. 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, storing the smaller value. The aq/rl bits provide release-consistency ordering without changing the data computation.
Shows Zabha (requires Zaamo) halfword atomic field decode, aq/rl ordering bits, a memory read, and RMW state update.
Zabha depends on Zaamo; Zabha-extension halfword atomic instructions use a 32-bit encoding; the animation starts by splitting the fields.
Assumes Zabha and Zaamo at the selected XLEN, successful fetch, a region supporting this width and operation, and a successful access. A misaligned halfword requires the stated PMA condition. Sources use pre-execution values; aq/rl orders only the accessed domain. Steps are a teaching sequence.
AMOMINU.H is a 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 smaller value.
RV32/RV64 Zabha+Zaamo, a1=0x1000, old 16-bit memory=0x8000 and a2=1; assume a supporting region and normal completion: amominu.h a0, a2, (a1) returns a0=0xFFFF8000 (RV32) or 0xFFFFFFFFFFFF8000 (RV64) and writes 0x0001 to memory. The data operation is 16-bit unsigned minimum.
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.