在 2021-05-04 18:03, Christian Franke 写道:

Next try attached.


Thanks. This patch looks good to me. I may push this one if others don't have 
objections on it.


If the '__atomic*()' are not used, gcc 10.2.0 -O2 generates the same code. '__ATOMIC_SEQ_CST' would make a difference: the store is done via xchgq instead of movq then.


Yes that is why I disrecommend `_Atomic`. Most x86 instructions guarantee only acquire-release memory order. The default (strongest) memory order of `_Atomic` requires the `LOCK` prefix (which is implied by `XCHG` when an operand is RAM) [1].


[1] https://stackoverflow.com/questions/27595595/when-are-x86-lfence-sfence-and-mfence-instructions-required



--
Best regards,
Liu Hao

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to