Can WRS.NTO replace LR/SC?
No. It waits on a reservation set established by LR; it performs neither the LR load nor the SC conditional store.
Wait on reservation set with no timeout
No explicit operands; requires Zawrs. To wait for a memory store, first use LR to reserve a set containing the target bytes.
32-bit SYSTEM I-type fields: funct12=000000001101, rs1=00000, funct3=000, rd=00000, opcode=1110011.
A stall is possible while the reservation is valid and no pending interrupt is observed; there is no built-in short timeout. The implementation may occasionally complete for any reason; software must recheck its condition.
Outside M, TW=1 causes an illegal-instruction exception on noncompletion within an implementation-specific bounded time. In VS/VU, TW=0 and VTW=1 cause a virtual-instruction exception on the same noncompletion condition.
WRS.NTO uses opcode 1110011 (0x73), funct3 000, funct12 000000001101. 32-bit SYSTEM I-type fields: funct12=000000001101, rs1=00000, funct3=000, rd=00000, opcode=1110011.
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.
In a polling loop, use LR to establish a reservation set covering the target bytes, then decide from the shared state whether to wait. Reload and test after returning; completion does not prove a target store occurred.
In a polling loop, use LR to establish a reservation set covering the target bytes, then decide from the shared state whether to wait. Reload and test after returning; completion does not prove a target store occurred.
No. It waits on a reservation set established by LR; it performs neither the LR load nor the SC conditional store.
No. An implementation may end the stall for any reason; software must re-check the condition.