2 ms·
If you really want that, just do a relaxed read into a local variable, increment there and relaxed store afterwards. At least clang will give you exactly the as
by tpolzer 9y ago
If you really want that, just do a relaxed read into a local variable, increment there and relaxed store afterwards. At least clang will give you exactly the assembly you want, minus the technically undefined behavior:
https://godbolt.org/g/9ikt1m https://godbolt.org/g/9ikt1m