GCC 17 Compiler Adding "-m128bit-atomic" For 128-bit Atomic Memory Operations

GCC 17 Compiler Adding "-m128bit-atomic" For 128-bit Atomic Memory Operations

Merged today to the GNU Compiler Collection Git code is the new -m128bit-atomic option for next year's GCC 17 feature release. 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.

Original Source

Read the full article at Phoronix →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.