stwat
Store Word Atomic
Stores a word atomically to memory.
Details
The stwat instruction stores a word atomically to memory. The effective address (EA) is determined by the contents of register RA. If RA is zero, EA is set to zero; otherwise, EA is set to the value in RA. The function code FC specifies how the storage at EA is updated.
Pseudocode Operation
if RA=0 then
EA ←0
else
EA ←(RA)
mem(EA,8)←stat(mem(EA,8), RS32:63, FC)
Programming Note
The stwat instruction atomically updates a word in memory at the address specified by register RA. Ensure that RA is properly aligned to avoid exceptions. The function code FC determines the specific update operation; consult the ISA documentation for valid operations. This instruction operates at user privilege level and does not generate any exceptions under normal conditions.
Example
Encoding
Operands
-
RS
Source General Purpose Register -
RA
Address General Purpose Register -
FC
Function Code