From 220d9578f9f5119a28d70a4245a95d4c37971f4b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 14 Jun 2022 14:15:24 +0200 Subject: [PATCH] Better comment about why mov is enoug for atomic store/load --- lib/compiler-singlepass/src/machine_x64.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/compiler-singlepass/src/machine_x64.rs b/lib/compiler-singlepass/src/machine_x64.rs index 38ed3adbcc1..83bd1af147f 100644 --- a/lib/compiler-singlepass/src/machine_x64.rs +++ b/lib/compiler-singlepass/src/machine_x64.rs @@ -3151,7 +3151,9 @@ impl Machine for MachineX86_64 { }, ); } - // x86_64 have a strong memory model, aligned move is guarantied to be atomic, too or from memory + // x86_64 have a strong memory model, so coherency between all threads (core) is garantied + // and aligned move is guarantied to be atomic, too or from memory + // so store/load an atomic is a simple mov on x86_64 fn i32_atomic_save( &mut self, value: Location,