(In reply to Sunil Pandey from comment #4) > Created attachment 12601 [details] > strncmp_avx2 patch for pr25933 > > Tested attached patch on > > https://gitlab.com/x86-glibc/glibc/-/commits/users/hjl/pr25933/master
Looks good. Please try this
diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S b/sysdeps/x86_64/multiarch/strcmp-avx2.S index 48d03a9f46..dabc3e7590 100644 --- a/sysdeps/x86_64/multiarch/strcmp-avx2.S +++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S @@ -256,6 +256,11 @@ L(next_3_vectors): vpmovmskb %ymm0, %ecx testl %ecx, %ecx jne L(return_3_vec_size) +# ifdef USE_AS_STRNCMP + /* Check if VEC_SIZE * 4 already exceeded max compare count %r11 */ + cmpq $(VEC_SIZE * 4), %r11 + jbe L(zero) +# endif L(main_loop_header): leaq (VEC_SIZE * 4)(%rdi), %rdx movl $PAGE_SIZE, %ecx
(In reply to Sunil Pandey from comment #4) /gitlab. com/x86- glibc/glibc/ -/commits/ users/hjl/ pr25933/ master
> Created attachment 12601 [details]
> strncmp_avx2 patch for pr25933
>
> Tested attached patch on
>
> https:/
Looks good. Please try this
diff --git a/sysdeps/ x86_64/ multiarch/ strcmp- avx2.S b/sysdeps/ x86_64/ multiarch/ strcmp- avx2.S .dabc3e7590 100644 x86_64/ multiarch/ strcmp- avx2.S x86_64/ multiarch/ strcmp- avx2.S 3_vec_size) loop_header) :
index 48d03a9f46.
--- a/sysdeps/
+++ b/sysdeps/
@@ -256,6 +256,11 @@ L(next_3_vectors):
vpmovmskb %ymm0, %ecx
testl %ecx, %ecx
jne L(return_
+# ifdef USE_AS_STRNCMP
+ /* Check if VEC_SIZE * 4 already exceeded max compare count %r11 */
+ cmpq $(VEC_SIZE * 4), %r11
+ jbe L(zero)
+# endif
L(main_
leaq (VEC_SIZE * 4)(%rdi), %rdx
movl $PAGE_SIZE, %ecx