News: 0001594095

  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)

Glibc Math Code Sees 4x Improvement On AMD Zen By Changing FMA Implementation

([GNU] 5 Hours Ago Glibc)


Merged this week to the GNU C Library "glibc" code is dropping the ldbl-96 FMA implementation from this library as in doing so they found a 4x improvement to throughput and latency on AMD Zen 3 hardware.

Replacing Glibc's long double implementation using 96-bit precision for internal calculations with the 64-bit double FMA implementation ended up netting a nice win for this widely-used libc implementation.

On "recent x86 hardware" the ldbl-64 implementation far outpaces the ldbl-96 code that has been removed from Glibc Git. In x86_64 benchmarks the throughput on AMD Zen 3 testing was 4.06x and for latency was also a 4.00x improvement. For i686 mode it was still a hefty 2.2~2.3x improvement.

The change to drop the ldbl-96 FMA implementation from Glibc's math code happened with [1]this commit now in Glibc Git.

This will in turn be released with Glibc 2.43 due for release in February. Glibc 2.43 also is bringing [2]detection for newer CPUs , [3]the MSEAL function , and other performance optimizations.



[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=42f07a44ef88e0c9ff1bd5343786013272467414

[2] https://www.phoronix.com/news/Glibc-Nova-Lake-Wildcat-Lake

[3] https://www.phoronix.com/news/Glibc-Linux-mseal-Function



High Priest: Armaments Chapter One, verses nine through twenty-seven:
Bro. Maynard: And Saint Attila raised the Holy Hand Grenade up on high
saying, "Oh Lord, Bless us this Holy Hand Grenade, and with it
smash our enemies to tiny bits." And the Lord did grin, and the
people did feast upon the lambs, and stoats, and orangutans, and
breakfast cereals, and lima bean-
High Priest: Skip a bit, brother.
Bro. Maynard: And then the Lord spake, saying: "First, shalt thou take
out the holy pin. Then shalt thou count to three. No more, no less.
*Three* shall be the number of the counting, and the number of the
counting shall be three. *Four* shalt thou not count, and neither
count thou two, excepting that thou then goest on to three. Five is
RIGHT OUT. Once the number three, being the third number be reached,
then lobbest thou thy Holy Hand Grenade towards thy foe, who, being
naughty in my sight, shall snuff it. Amen.
All: Amen.
-- Monty Python, "The Holy Hand Grenade"