[PATCH v7 4/4] x86/string: Make page-unrolled memmove default for Intel processors
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Thu Nov 5 11:44:49 GMT 2026
On 05/11/26 08:09, Florian Weimer wrote:
> * Noah Goldstein:
>
>> Continue using page-unrolled large memmove implementation for all
>> Intel processors to stay consistent with how it has been since glibc
>> 2.34.
>>
>> So far the page-unrolled implementation has been benchmarked on
>> HSW-SPR, with it yielding 5-15% performance improvements on
>> HSW-ICX. On SPR it appears to be roughly equal, and it is not known
>> how it compares on newer hardware (although Sunil has some benchmarks
>> that suggest it may still yield performance improvements).
>>
>> Since as of now, we only have positive or roughly neutral benchmark
>> results on Intel hardware, it seems fair to continue using this
>> implementation as the default. It would be prudent, however, to
>> continue benchmarking the page-unrolled vs standard implementation for
>> future hardware to ensure that is remains performant.
>> ---
>> sysdeps/x86/cpu-features.c | 14 ++++
>> sysdeps/x86_64/multiarch/Makefile | 2 +
>> sysdeps/x86_64/multiarch/ifunc-impl-list.c | 72 +++++++++++++++++--
>> sysdeps/x86_64/multiarch/ifunc-memmove.h | 38 +++++++---
>> ...move-avx512-unaligned-erms-page-unrolled.S | 24 +++++++
>> ...emmove-sse2-unaligned-erms-page-unrolled.S | 24 +++++++
>> .../multiarch/memmove-sse2-unaligned-erms.S | 2 +-
>> 7 files changed, 161 insertions(+), 15 deletions(-)
>> create mode 100644 sysdeps/x86_64/multiarch/memmove-avx512-unaligned-erms-page-unrolled.S
>> create mode 100644 sysdeps/x86_64/multiarch/memmove-sse2-unaligned-erms-page-unrolled.S
>
> This change broke the build with -march=x86-64-v3:
>
> gcc -pipe -march=x86-64-v3 -nostdlib -nostartfiles -r -o /home/fweimer/src/gnu/glibc/build/elf/dl-allobjs.os […] /home/fweimer/src/gnu/glibc/build/elf/dl-sbrk.os
> for symbol in __libc_assert_fail __libc_single_threaded_internal __syscall_cancel_arch __syscall_do_cancel calloc free malloc realloc __GI_abort __GI___chk_fail __GI___vfprintf_chk __GI___vsprintf_chk __GI___vsyslog_chk __stack_chk_fail __stack_chk_fail_local; do \
> echo ".globl $symbol"; \
> echo "$symbol:"; \
> done | gcc -pipe -march=x86-64-v3 -o /home/fweimer/src/gnu/glibc/build/elf/librtld.mapT.o -g -Werror=undef -Wa,--noexecstack -c -x assembler -
> gcc -pipe -march=x86-64-v3 -nostdlib -nostartfiles -r -o /home/fweimer/src/gnu/glibc/build/elf/librtld.map.o /home/fweimer/src/gnu/glibc/build/elf/librtld.mapT.o '-Wl,-(' /home/fweimer/src/gnu/glibc/build/elf/dl-allobjs.os /home/fweimer/src/gnu/glibc/build/libc_pic.a -lgcc '-Wl,-)' -Wl,-Map,/home/fweimer/src/gnu/glibc/build/elf/librtld.mapT
> /usr/bin/ld.bfd: /home/fweimer/src/gnu/glibc/build/libc_pic.a(memmove-avx-unaligned-erms-page-unrolled.os): in function `__memcpy_avx_unaligned_page_unrolled':
> /home/fweimer/src/gnu/glibc/git/string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:159: multiple definition of `memcpy@GLIBC_2.2.5'; /home/fweimer/src/gnu/glibc/build/libc_pic.a(memmove-avx-unaligned-erms.os):/home/fweimer/src/gnu/glibc/git/string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:159: first defined here
> collect2: error: ld returned 1 exit status
> make[2]: *** [../Makerules:626: /home/fweimer/src/gnu/glibc/build/libc_pic.os] Error 1
> make[2]: *** Waiting for unfinished jobs....
> collect2: error: ld returned 1 exit status
> make[2]: *** [Makefile:1646: /home/fweimer/src/gnu/glibc/build/elf/librtld.map] Error 1
> make[2]: Leaving directory '/home/fweimer/src/gnu/glibc/git/elf'
> make[1]: *** [Makefile:488: elf/subdir_lib] Error 2
> make[1]: Leaving directory '/home/fweimer/src/gnu/glibc/git'
> make: *** [Makefile:22: all] Error 2
>
> Thanks,
> Florian
I will take a look at this.
More information about the Libc-alpha
mailing list