Does rd hold the stored data when SC.D succeeds?
No. rd is the status-result register: success writes 0 and failure writes nonzero; the memory data comes from rs2.
RV64 64-bit store-conditional: success stores data and returns rd=0; failure performs no data store and returns nonzero.
Extension condition: RV64, requiring Zalrsc or the A extension that includes Zalrsc.
SC.D uses rs1 as the address and rs2's low 64 bits as candidate data. Success stores data and writes zero to rd; failure performs no data store and writes a nonzero code to rd. Success requires a valid reservation from the most recent LR covering the written bytes, but a valid reservation does not guarantee success. Relevant writes by another hart, device writes to LR-accessed bytes, or an intervening SC force failure. Both outcomes invalidate this hart's reservation. SC must pass memory permission checks before retiring; side effects of implicit translation/protection accesses on failure are unspecified. SC.D is RV64-only.
Shows A / Zalrsc doubleword atomic field decode, aq/rl ordering bits, reservation and permission checks, and store-conditional state update.
This teaching toggle selects the SC success or failure outcome; success still depends on the most recent LR reservation and other architectural conditions, and a failure code is only guaranteed to be nonzero.
A / Zalrsc-extension doubleword atomic instructions use a 32-bit encoding; the animation starts by splitting the fields.
Assumes successful fetch, a naturally aligned LR/SC-capable region and passed memory permission checks. The toggle chooses a permitted SC success/failure outcome; LR, the reservation set and other hart/device interference are not fully modeled. Failure performs no data store, but implicit translation/protection side effects are unspecified. aq/rl concerns only the accessed memory/I/O domain; steps are a teaching sequence.
SC.D is the conditional write point of an RV64 LR/SC sequence. On success it stores the 64-bit rs2 value and writes rd=0; on failure it performs no data store and rd is nonzero.
SC.D supports LR/SC conditional updates; software checks rd for zero/nonzero, and a valid reservation does not guarantee success.
No. rd is the status-result register: success writes 0 and failure writes nonzero; the memory data comes from rs2.
A failed SC performs no data store, writes nonzero status (discarded for rd=x0), and invalidates the reservation. Side effects of implicit translation/protection accesses are unspecified.