
The -m128bit-atomic option is used for GCC to enable generation of instructions for 128-bit atomic memory operations on capable Intel / AMD / Zhaoxin / Hygon processors. This GCC built-in option allows avoiding the overhead of otherwise using the libatomic library.
Besides adding -m128bit-atomic itself, the new GCC Git code also now enables the option by default if supported by the targeting processor via -march=native or similar. Adding this option came about after the x86_64 CPU vendors confirmed their support around 128-bit atomic loads and stores.
x86-64: Add -m128bit-atomic
With the silicon vendor guarantees from Intel, AMD, Hygon and Zhaoxin in:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104688
many software developers would happily use inline 128-bit atomic loads and stores in their programs because they only target compatible CPUs. Add -m128bit-atomic to generate 128-bit atomic loads and stores to avoid the overhead of calling into libatomic. Enable -m128bit-atomic in 64-bit mode by default if supported by the targeting processor, which is one of x86-64-v3 capable processors as well as AVX capable processors from Intel, AMD, Hygon and Zhaoxin.
The support landed via this commit . Look for this in the GCC 17.1 stable release due out next spring.