From a1de30c6ae99af046735670b421f9709c6315b62 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Mar 14 2021 14:58:02 +0000 Subject: Apply patch glibc-rh1871394-1.patch patch_name: glibc-rh1871394-1.patch present_in_specfile: true location_in_specfile: 359 --- diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S b/sysdeps/x86_64/multiarch/strcmp-avx2.S index e8397f3..327e3d8 100644 --- a/sysdeps/x86_64/multiarch/strcmp-avx2.S +++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S @@ -591,7 +591,14 @@ L(loop_cross_page_2_vec): movl $(PAGE_SIZE / (VEC_SIZE * 4) - 1), %esi testq %rdi, %rdi +# ifdef USE_AS_STRNCMP + /* At this point, if %rdi value is 0, it already tested + VEC_SIZE*4+%r10 byte starting from %rax. This label + checks whether strncmp maximum offset reached or not. */ + je L(string_nbyte_offset_check) +# else je L(back_to_loop) +# endif tzcntq %rdi, %rcx addq %r10, %rcx /* Adjust for number of bytes skipped. */ @@ -627,6 +634,14 @@ L(loop_cross_page_2_vec): VZEROUPPER ret +# ifdef USE_AS_STRNCMP +L(string_nbyte_offset_check): + leaq (VEC_SIZE * 4)(%r10), %r10 + cmpq %r10, %r11 + jbe L(zero) + jmp L(back_to_loop) +# endif + .p2align 4 L(cross_page_loop): /* Check one byte/dword at a time. */