Can WRS.NTO replace LR/SC?
No. It waits on a reservation set; LR/SC, AMO, or CAS updates shared state.
Wait on reservation set with no timeout
WRS-NTO uses opcode 1110011 (0x73), funct3 000, funct12 000000001101, rs2 fixed x0. This fixed SYSTEM encoding has no explicit assembly register or immediate operand; funct12, rs1, funct3, rd, and opcode must match the constants listed in the manual.
May temporarily stall a hart while its LR-established reservation set is valid and no pending interrupt is observed, even if disabled. An implementation may occasionally end the stall for any reason.
WRS.NTO is a Zawrs wait-on-reservation-set instruction: a hart can temporarily stall while its reservation set is valid and no pending interrupt is observed; LR establishes that reservation set.
Understand this scenario with real code like «retry: lr.w x10, (x11) ; ... ; wrs.nto ; j retry».
Understand this scenario with real code like «retry: lr.w x10, (x11) ; ... ; wrs.nto ; j retry».
Understand this scenario with real code like «retry: lr.w x10, (x11) ; ... ; wrs.nto ; j retry».
No. It waits on a reservation set; LR/SC, AMO, or CAS updates shared state.
No. An implementation may end the stall for any reason; software must re-check the condition.