x86-64: Require BMI2 for __strlen_evex and __strnlen_evex

Message ID 20210419141831.546059-1-hjl.tools@gmail.com
State Committed
Commit 55bf411b451c13f0fb7ff3d3bf9a820020b45df1
Headers
Series x86-64: Require BMI2 for __strlen_evex and __strnlen_evex |

Commit Message

H.J. Lu April 19, 2021, 2:18 p.m. UTC
  I am committing this patch as an obvious fix.

H.J.
---
Since __strlen_evex and __strnlen_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.
---
 sysdeps/x86_64/multiarch/ifunc-impl-list.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Florian Weimer April 19, 2021, 2:29 p.m. UTC | #1
* H. J. Lu via Libc-alpha:

> I am committing this patch as an obvious fix.

Can you add a reference to the commit that is fixed?  Thanks.

Florian
  
H.J. Lu April 19, 2021, 2:53 p.m. UTC | #2
On Mon, Apr 19, 2021 at 7:29 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu via Libc-alpha:
>
> > I am committing this patch as an obvious fix.
>
> Can you add a reference to the commit that is fixed?  Thanks.

Here is the commit message I am checking in:

---
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.
---

Thanks.
  

Patch

diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
index 770986e41a..f1a755b1d6 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,
 			      (CPU_FEATURE_USABLE (AVX512VL)
-			       && CPU_FEATURE_USABLE (AVX512BW)),
+			       && CPU_FEATURE_USABLE (AVX512BW)
+			       && CPU_FEATURE_USABLE (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,
 			      (CPU_FEATURE_USABLE (AVX512VL)
-			       && CPU_FEATURE_USABLE (AVX512BW)),
+			       && CPU_FEATURE_USABLE (AVX512BW)
+			       && CPU_FEATURE_USABLE (BMI2)),
 			      __strnlen_evex)
 	      IFUNC_IMPL_ADD (array, i, strnlen, 1, __strnlen_sse2))