mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-27 05:00:15 +00:00
830566307f
Implement x86-64 memset with unaligned store and rep movsb. Support 16-byte, 32-byte and 64-byte vector register sizes. A single file provides 2 implementations of memset, one with rep stosb and the other without rep stosb. They share the same codes when size is between 2 times of vector register size and REP_STOSB_THRESHOLD which defaults to 2KB. Key features: 1. Use overlapping store to avoid branch. 2. For size <= 4 times of vector register size, fully unroll the loop. 3. For size > 4 times of vector register size, store 4 times of vector register size at a time. [BZ #19881] * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add memset-sse2-unaligned-erms, memset-avx2-unaligned-erms and memset-avx512-unaligned-erms. * sysdeps/x86_64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Test __memset_chk_sse2_unaligned, __memset_chk_sse2_unaligned_erms, __memset_chk_avx2_unaligned, __memset_chk_avx2_unaligned_erms, __memset_chk_avx512_unaligned, __memset_chk_avx512_unaligned_erms, __memset_sse2_unaligned, __memset_sse2_unaligned_erms, __memset_erms, __memset_avx2_unaligned, __memset_avx2_unaligned_erms, __memset_avx512_unaligned_erms and __memset_avx512_unaligned. * sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms.S: New file. * sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S: Likewise. * sysdeps/x86_64/multiarch/memset-sse2-unaligned-erms.S: Likewise. * sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S: Likewise.
39 lines
1.3 KiB
Makefile
39 lines
1.3 KiB
Makefile
ifeq ($(subdir),csu)
|
|
tests += test-multiarch
|
|
gen-as-const-headers += ifunc-defines.sym
|
|
endif
|
|
|
|
ifeq ($(subdir),string)
|
|
|
|
sysdep_routines += strncat-c stpncpy-c strncpy-c strcmp-ssse3 \
|
|
strcmp-sse2-unaligned strncmp-ssse3 \
|
|
memcmp-sse4 memcpy-ssse3 memcpy-sse2-unaligned \
|
|
memmove-ssse3 \
|
|
memcpy-ssse3-back memmove-avx-unaligned \
|
|
memcpy-avx-unaligned \
|
|
memmove-ssse3-back \
|
|
memmove-avx512-no-vzeroupper strcasecmp_l-ssse3 \
|
|
strncase_l-ssse3 strcat-ssse3 strncat-ssse3\
|
|
strcpy-ssse3 strncpy-ssse3 stpcpy-ssse3 stpncpy-ssse3 \
|
|
strcpy-sse2-unaligned strncpy-sse2-unaligned \
|
|
stpcpy-sse2-unaligned stpncpy-sse2-unaligned \
|
|
strcat-sse2-unaligned strncat-sse2-unaligned \
|
|
strchr-sse2-no-bsf memcmp-ssse3 strstr-sse2-unaligned \
|
|
strcspn-c strpbrk-c strspn-c varshift memset-avx2 \
|
|
memset-avx512-no-vzeroupper \
|
|
memmove-sse2-unaligned-erms \
|
|
memmove-avx-unaligned-erms \
|
|
memmove-avx512-unaligned-erms \
|
|
memset-sse2-unaligned-erms \
|
|
memset-avx2-unaligned-erms \
|
|
memset-avx512-unaligned-erms
|
|
CFLAGS-varshift.c += -msse4
|
|
CFLAGS-strcspn-c.c += -msse4
|
|
CFLAGS-strpbrk-c.c += -msse4
|
|
CFLAGS-strspn-c.c += -msse4
|
|
endif
|
|
|
|
ifeq ($(subdir),wcsmbs)
|
|
sysdep_routines += wmemcmp-sse4 wmemcmp-ssse3 wmemcmp-c wcscpy-ssse3 wcscpy-c
|
|
endif
|