News: 0001651601

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

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

([GNU] 3 Hours Ago -m128bit-atomic)


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 [1]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 [2]this commit . Look for this in the GCC 17.1 stable release due out next spring.



[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104688

[2] https://gcc.gnu.org/git?p=gcc.git;a=commit;h=d9e21f7c4d1666baec96398f07ac500d1c912a12



This telethon isn't just about helping disenfranchised geeks. We're
also here for the betterment of mankind through our research into finding
a Cure for Windows.

Each day, millions of man-hours are wasted due to design flaws in
Microsoft Windows. Each day, millions of dollars are sent by business and
individuals like yourself into a huge black hole known as "Microsoft" for
exorbitantly priced software products that should be free.

But don't worry. We've almost found a Cure for Windows. Geeks worldwide
have toiled endlessly for the past eight years working on a replacement
operating system called Linux. It's almost ready. Now we need to convince
the world to use our creation and eliminate the virus known as Windows.

-- Excerpt from Eric S. Raymond's speech during the Geek Grok '99
telethon held in Silicon Valley