Aligned 64-bit writes (like the one above) are atomic on x86_64. The ordering semantics of x86_64 are actually stronger than those of most "relaxed" orderings. Stores are not reordered with other stores, and loads are not reordered with other loads.
Yes, the guarantees hold for all of the mov instructions. Alignment is a factor because of caching (i.e. don't split a load/store over two cache lines).
6
u/An_Unhinged_Door Apr 01 '16
Aligned 64-bit writes (like the one above) are atomic on x86_64. The ordering semantics of x86_64 are actually stronger than those of most "relaxed" orderings. Stores are not reordered with other stores, and loads are not reordered with other loads.