diff options
author | Noah Goldstein <goldstein.w.n@gmail.com> | 2022-06-14 15:37:28 -0700 |
---|---|---|
committer | Noah Goldstein <goldstein.w.n@gmail.com> | 2022-06-14 20:58:09 -0700 |
commit | ff439c47173565fbff4f0f78d07b0f14e4a7db05 (patch) | |
tree | 6c50dc3e3914c3082174845a65808ed043e832ac | |
parent | 035591551400cfc810b07244a015c9411e8bff7c (diff) | |
download | glibc-ff439c47173565fbff4f0f78d07b0f14e4a7db05.tar.gz glibc-ff439c47173565fbff4f0f78d07b0f14e4a7db05.tar.xz glibc-ff439c47173565fbff4f0f78d07b0f14e4a7db05.zip |
x86: Add sse42 implementation to strcmp's ifunc
This has been missing since the the ifuncs where added. The performance of SSE4.2 is preferable to to SSE2. Measured on Tigerlake with N = 20 runs. Geometric Mean of all benchmarks SSE4.2 / SSE2: 0.906
-rw-r--r-- | sysdeps/x86_64/multiarch/strcmp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sysdeps/x86_64/multiarch/strcmp.c b/sysdeps/x86_64/multiarch/strcmp.c index a248c2a6e6..9c1677724c 100644 --- a/sysdeps/x86_64/multiarch/strcmp.c +++ b/sysdeps/x86_64/multiarch/strcmp.c @@ -28,6 +28,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (sse42) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_rtm) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (evex) attribute_hidden; @@ -52,6 +53,10 @@ IFUNC_SELECTOR (void) return OPTIMIZE (avx2); } + if (CPU_FEATURE_USABLE_P (cpu_features, SSE4_2) + && !CPU_FEATURES_ARCH_P (cpu_features, Slow_SSE4_2)) + return OPTIMIZE (sse42); + if (CPU_FEATURES_ARCH_P (cpu_features, Fast_Unaligned_Load)) return OPTIMIZE (sse2_unaligned); |