Does AMOMAX.D place the new memory result in rd?
No. AMOMAX.D places the old 64-bit memory value before the operation in rd; the result of signed max(oldDoubleword, rs2Doubleword) is written back to memory.
RV64 atomic signed-maximum 64-bit doubleword: rd returns the old memory value, while memory receives signed max(old, rs2)
AMOMAX.D performs an atomic read-modify-write on the 64-bit doubleword addressed by rs1: it first reads the old memory doubleword into rd, then computes signed max(oldDoubleword, rs2Doubleword) using signed maximum semantics and writes the 64-bit result back to the same address. The operation uses a signed 64-bit comparison; it is not a per-bit logical operation. aq/rl bits affect memory ordering only; they do not change the data result.
Shows A / Zaamo doubleword atomic field decode, aq/rl ordering bits, a memory read, and RMW state update.
A / Zaamo-extension doubleword atomic instructions use a 32-bit encoding; the animation starts by splitting the fields.
AMOMAX.D selects the memory writeback doubleword using a signed 64-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.D is an RV64 64-bit AMO.D read-modify-write instruction. On a successful access with rd other than x0, rd returns the old doubleword before the operation; only the result of signed max(oldDoubleword, rs2Doubleword) is written back to memory, so keep old-value return separate from memory update.
Successful 64-bit access example: a2=0x1000, old memory=5, a1=3; amomax.d a0, a1, (a2) returns a0=5 and updates memory to 5. The address is naturally aligned and the region supports this AMO.
Successful 64-bit access example: a2=0x1000, old memory=5, a1=3; amomax.d a0, a1, (a2) returns a0=5 and updates memory to 5. The address is naturally aligned and the region supports this AMO.
Successful 64-bit access example: a2=0x1000, old memory=5, a1=3; amomax.d a0, a1, (a2) returns a0=5 and updates memory to 5. The address is naturally aligned and the region supports this AMO.
No. AMOMAX.D places the old 64-bit memory value before the operation in rd; the result of signed max(oldDoubleword, rs2Doubleword) is written back to memory.
No. aq/rl only affect memory-ordering constraints; they do not change this AMO.D instruction's 64-bit data result.