Does AMOOR.W place the new memory result in rd?
No. AMOOR.W places the old memory word before the operation in rd; the result of oldWord | rs2LowWord is written back to memory.
Atomic 32-bit word bitwise OR: rd returns the old memory word, while memory receives the 32-bit result of oldWord | rs2LowWord
The following semantics assume the target region supports this AMO width and operation and the access succeeds. AMOOR.W performs an atomic read-modify-write on the 32-bit word addressed by rs1: it first reads the old memory word and sign-extends it into rd, then bitwise-ORs the old word with the low 32 bits of rs2. The resulting 32-bit word is written back to the same address. aq/rl add ordering only in the accessed memory or I/O address domain and do not change the bitwise-OR data result; ordering across both domains still needs FENCE. rs2 uses its pre-execution value; rd=x0 discards only the old-value register writeback, while the memory operation still occurs.
Shows A / Zaamo word atomic field decode, aq/rl ordering bits, a memory read, and RMW state update.
A / Zaamo-extension word atomic instructions use a 32-bit encoding; the animation starts by splitting the fields.
Assumes the region supports this AMO and the access succeeds. Shows the operation, old-value return, memory update and aq/rl ordering in the accessed domain. Steps are a teaching sequence; access faults, CPU cache coherence, pipelines and timing are not modeled.
AMOOR.W is used for atomic bit setting or flag merging. The value returned in rd on successful access with rd≠x0 is the old memory word; the new 32-bit word after the bitwise OR operation is written only to memory.
Successful 32-bit access example: a2=0x1000, old memory=5, a1=3; amoor.w a0, a1, (a2) returns a0=5 and updates memory to 7. The address is naturally aligned and the region supports this AMO.
Successful 32-bit access example: a2=0x1000, old memory=5, a1=3; amoor.w a0, a1, (a2) returns a0=5 and updates memory to 7. The address is naturally aligned and the region supports this AMO.
No. AMOOR.W places the old memory word before the operation in rd; the result of oldWord | rs2LowWord is written back to memory.
No. aq/rl only affect memory-ordering constraints; they do not change this AMO.W instruction's 32-bit data result.