Glibc-HWCAPS To Help With AMD Zen Optimizations, Other Per-CPU Performance Bits
This glibc-hwcaps work sent out under a "request for comments" flag at the end of June was carried out by Red Hat's Florian Weimer. He began this patch series stemming from the work on the bug/issue around providing better optimized AMD Zen support by potentially following Haswell optimizations rather than a more generic target. Prior to this glibc-hwcaps patch series, it was a few months back that AMD was said to be engaged on this matter as well.
With the new patches, a new subdirectory called "glibc-hwcaps" can be used with nested sub-directories for containing alternative library implementations. This glibc-hwcaps subdirectory can be used on every sub-directory of the library search path. The ldconfig command and dynamic loader are plumbed to properly check for files in the sub-directories and add to the cache with that file. The dynamic loader will check for the presence of any specialized files and if supported use the alternative library.
Ultimately with glibc-hwcaps is the start of the infrastructure for more easily being able to ship optimized libraries / shared objects depending upon the hardware capabilities. This is at the library level for providing drop-in optimized libraries as opposed to the likes of GCC's FMV (Function Multi-Versioning) that at build-time is trying to provide optimized functions that are then chose at run-time depending upon the CPU host.
Thus the likes of AMD Zen processors could leverage this infrastructure for more easily deploying Zen-optimized versions of key libraries in the name of greater performance. This common infrastructure can also be used by other x86_64 CPUs as well as other architectures like POWER9 and s390x.
More details via this patch series which hopefully will come to stable fruition soon enough and unfortunate that it has taken until 2020 for having such infrastructure in place.