about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-04-19 07:07:21 -0700
committerH.J. Lu <hjl.tools@gmail.com>2022-01-27 16:25:20 -0800
commit3fc179e2b23efe3a14aaffc4c47cd5919efdf5bb (patch)
tree16537c5b5d845e7c9e4a2b6229c926b568166f0f /sysdeps
parentc3535cb6cdd4cbbce22018df09cc69633781d808 (diff)
downloadglibc-3fc179e2b23efe3a14aaffc4c47cd5919efdf5bb.tar.gz
glibc-3fc179e2b23efe3a14aaffc4c47cd5919efdf5bb.tar.xz
glibc-3fc179e2b23efe3a14aaffc4c47cd5919efdf5bb.zip
x86-64: Require BMI2 for __strlen_evex and __strnlen_evex
Since __strlen_evex and __strnlen_evex added by

commit 1fd8c163a83d96ace1ff78fa6bac7aee084f6f77
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Mar 5 06:24:52 2021 -0800

    x86-64: Add ifunc-avx2.h functions with 256-bit EVEX

use sarx:

c4 e2 6a f7 c0       	sarx   %edx,%eax,%eax

require BMI2 for __strlen_evex and __strnlen_evex in ifunc-impl-list.c.
ifunc-avx2.h already requires BMI2 for EVEX implementation.

(cherry picked from commit 55bf411b451c13f0fb7ff3d3bf9a820020b45df1)
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-impl-list.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
index b0ae7ed0da..bfe1a4ce53 100644
--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
@@ -293,7 +293,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 			      __strlen_avx2_rtm)
 	      IFUNC_IMPL_ADD (array, i, strlen,
 			      (HAS_ARCH_FEATURE (AVX512VL_Usable)
-			       && HAS_ARCH_FEATURE (AVX512BW_Usable)),
+			       && HAS_ARCH_FEATURE (AVX512BW_Usable)
+			       && HAS_CPU_FEATURE (BMI2)),
 			      __strlen_evex)
 	      IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2))
 
@@ -308,7 +309,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 			      __strnlen_avx2_rtm)
 	      IFUNC_IMPL_ADD (array, i, strnlen,
 			      (HAS_ARCH_FEATURE (AVX512VL_Usable)
-			       && HAS_ARCH_FEATURE (AVX512BW_Usable)),
+			       && HAS_ARCH_FEATURE (AVX512BW_Usable)
+			       && HAS_CPU_FEATURE (BMI2)),
 			      __strnlen_evex)
 	      IFUNC_IMPL_ADD (array, i, strnlen, 1, __strnlen_sse2))