mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-28 05:21:13 +00:00
93e46f8773
Implement memset family IFUNC selectors in C. All internal calls within libc.so can use IFUNC on x86-64 since unlike x86, x86-64 supports PC-relative addressing to access the GOT entry so that it can call via PLT without using an extra register. For libc.a, we can't use IFUNC for functions which are called before IFUNC has been initialized. Use IFUNC internally reduces the icache footprint since libc.so and other codes in the process use the same implementations. This patch uses IFUNC for memset functions within libc. 2017-06-07 H.J. Lu <hongjiu.lu@intel.com> Erich Elsen <eriche@google.com> * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add memset-sse2-unaligned-erms, and memset_chk-nonshared. * sysdeps/x86_64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Add test for __memset_chk_erms. Update comments. * sysdeps/x86_64/multiarch/ifunc-memset.h: New file. * sysdeps/x86_64/multiarch/memset-sse2-unaligned-erms.S: Likewise. * sysdeps/x86_64/multiarch/memset.c: Likewise. * sysdeps/x86_64/multiarch/memset_chk-nonshared.S: Likewise. * sysdeps/x86_64/multiarch/memset_chk.c: Likewise. * sysdeps/x86_64/multiarch/memset.S: Removed. * sysdeps/x86_64/multiarch/memset_chk.S: Likewise. * sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S (__memset_chk_erms): New function.
57 lines
1.8 KiB
Makefile
57 lines
1.8 KiB
Makefile
ifeq ($(subdir),csu)
|
|
tests += test-multiarch
|
|
endif
|
|
|
|
ifeq ($(subdir),string)
|
|
|
|
sysdep_routines += strncat-c stpncpy-c strncpy-c strcmp-ssse3 \
|
|
strcmp-sse2-unaligned strncmp-ssse3 \
|
|
memchr-sse2 rawmemchr-sse2 memchr-avx2 rawmemchr-avx2 \
|
|
memrchr-sse2 memrchr-avx2 \
|
|
memcmp-avx2-movbe \
|
|
memcmp-sse4 memcpy-ssse3 \
|
|
memmove-ssse3 \
|
|
memcpy-ssse3-back \
|
|
memmove-ssse3-back \
|
|
memmove-avx512-no-vzeroupper strcasecmp_l-ssse3 \
|
|
strchr-sse2 strchrnul-sse2 strchr-avx2 strchrnul-avx2 \
|
|
strrchr-sse2 strrchr-avx2 \
|
|
strlen-sse2 strnlen-sse2 strlen-avx2 strnlen-avx2 \
|
|
strncase_l-ssse3 strcat-ssse3 strncat-ssse3\
|
|
strcpy-sse2 stpcpy-sse2 \
|
|
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-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 \
|
|
wmemcmp-avx2-movbe \
|
|
wmemchr-sse2 wmemchr-avx2 \
|
|
wcscpy-ssse3 wcscpy-c \
|
|
wcschr-sse2 wcschr-avx2 \
|
|
wcsrchr-sse2 wcsrchr-avx2 \
|
|
wcsnlen-sse4_1 wcsnlen-c \
|
|
wcslen-sse2 wcslen-avx2 wcsnlen-avx2
|
|
endif
|
|
|
|
ifeq ($(subdir),debug)
|
|
sysdep_routines += memcpy_chk-nonshared mempcpy_chk-nonshared \
|
|
memmove_chk-nonshared memset_chk-nonshared \
|
|
wmemset_chk-nonshared
|
|
endif
|