Targets typically support atomics that are word sized (e.g. 32 or 64 bit) or
half word sized (e.g. 32 bit on 64 bit systems). For larger sizes, some
targets can perform them directly (x86, ARM), other must expand them into
a library call. This patch adds the optional warning -Watomic-libcall which
warns when a atomic operation cannot be expanded inline and must use a
library call.
Details
Details
- Reviewers
joerg
Diff Detail
Diff Detail
Event Timeline
Comment Actions
While I agree with the general sentiment, the check doesn't work at all. For example, ARMv4 always has to use libcalls. It's not even true that libcalls are slow, i.e. on true non-parallel architectures, the libcall can be as simple as a restartable atomic sequence and is almost cost free beyond the function call overhead.
Comment Actions
More precisely, this should re-use the logic from __atomic_is_lock_free and not reinvent it.
Comment Actions
I removed myself from the reviewers because I'm not quite familiar with this area. @joerg I added you as reviewer because you've already commented, feel free to undo my change if you don't have time to review this.