Glibc's strncasecmp / strcasecmp Get AVX2 & EVEX Optimized Versions, Drops AVX

Written by Michael Larabel in GNU on 30 March 2022 at 03:20 PM EDT. 29 Comments
GNU --
The GNU C Library (glibc) has landed a set of 23 patches providing optimized AVX2 and EVEX versions of strcasecmp/strncasecmp functions while dropping support for the original AVX implementation.

A patch series by Noah Goldstein was merged to Glibc Git this past weekend offering up AVX2 and EVEX optimized versions of the str{n}casecmp functions -- commonly used functions for string comparisons -- for this widely used C library on Linux systems.

The AVX2 optimized version of these functions took around a third less time as the SSE4.2 implementation. Meanwhile the EVEX version of these functions in the same benchmarks against the SSE 4.2 code path took 38% less time.


Now with having an AVX2 implementation, the original Advanced Vector Extensions (AVX) version of the strcasecmp/strncasecmp functions is being removed. That AVX version is being dropped since its performance is similar to that of the SSE 4.2 implementation and AVX2 is widely supported across modern versions. The processors that principally benefit from the AVX(1) version are Sandy Bridge and Ivy Bridge to which they are "becoming outdated" and thus freeing that code from the Glibc code-base.

See these patches if interested in the details.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week