* Richard Henderson: > Therefore, I've created small out-of-line helpers that are directly > linked into every library or executable that requires them. There > will be two direct branches, both of which will be well-predicted.
This work inspired me to put together something that provides a similar hidden variable, comparable to __aa64_have_atomics, to libc_nonshared.a in glibc: <https://sourceware.org/ml/libc-alpha/2019-02/msg00073.html> I hope it can be eventually be used to dynamically optimize the use of atomics in the std::shared_ptr implementation in libstdc++. For a generic optimization of all atomics, this is not suitable because even a single-threaded process can have MAP_SHARED mappings and will have to use atomics there. Thanks, Florian