mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-12 06:10:10 +00:00
18b6e2c86c
Added strnlen POWER8 otimized for long strings. It delivers same performance as POWER7 implementation for short strings. This takes advantage of reasonably performing unaligned loads and bit permutes to check the first 1-16 bytes until quadword aligned, then checks in 64 bytes strides until unsafe, then 16 bytes, truncating the count if need be. Likewise, the POWER7 code is recycled for less than 32 bytes strings. Tested on ppc64 and ppc64le. * sysdeps/powerpc/powerpc64/multiarch/Makefile (sysdep_routines): Add strnlen-power8. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c (strnlen): Add __strnlen_power8 to list of strnlen functions. * sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S: New file. * sysdeps/powerpc/powerpc64/multiarch/strnlen.c (__strnlen): Add __strnlen_power8 to ifunc list. * sysdeps/powerpc/powerpc64/power8/strnlen.S: New file.
46 lines
1.9 KiB
Makefile
46 lines
1.9 KiB
Makefile
ifeq ($(subdir),string)
|
|
sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
|
|
memcpy-power4 memcpy-ppc64 memcmp-power7 memcmp-power4 \
|
|
memcmp-ppc64 memset-power7 memset-power6 memset-power4 \
|
|
memset-ppc64 memset-power8 \
|
|
mempcpy-power7 mempcpy-ppc64 memchr-power7 memchr-ppc64 \
|
|
memrchr-power7 memrchr-ppc64 rawmemchr-power7 \
|
|
rawmemchr-ppc64 strlen-power7 strlen-ppc64 \
|
|
strnlen-power8 strnlen-power7 strnlen-ppc64 \
|
|
strcasecmp-power7 strcasecmp_l-power7 \
|
|
strncase-power7 strncase_l-power7 \
|
|
strncmp-power9 strncmp-power8 strncmp-power7 \
|
|
strncmp-power4 strncmp-ppc64 \
|
|
strchr-power8 strchr-power7 strchr-ppc64 \
|
|
strchrnul-power8 strchrnul-power7 strchrnul-ppc64 \
|
|
strcpy-power8 strcpy-power7 strcpy-ppc64 stpcpy-power8 \
|
|
stpcpy-power7 stpcpy-ppc64 \
|
|
strrchr-power7 strrchr-ppc64 strncat-power7 strncat-ppc64 \
|
|
strncpy-power7 strncpy-ppc64 \
|
|
stpncpy-power8 stpncpy-power7 stpncpy-ppc64 \
|
|
strcmp-power9 strcmp-power8 strcmp-power7 strcmp-ppc64 \
|
|
strcat-power8 strcat-power7 strcat-ppc64 \
|
|
memmove-power7 memmove-ppc64 wordcopy-ppc64 bcopy-ppc64 \
|
|
strncpy-power8 strstr-power7 strstr-ppc64 \
|
|
strspn-power8 strspn-ppc64 strcspn-power8 strcspn-ppc64 \
|
|
strlen-power8 strcasestr-power8 strcasestr-ppc64 \
|
|
strcasecmp-ppc64 strcasecmp-power8 strncase-ppc64 \
|
|
strncase-power8
|
|
|
|
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
|
|
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
|
|
endif
|
|
|
|
ifeq ($(subdir),wcsmbs)
|
|
sysdep_routines += wcschr-power7 wcschr-power6 wcschr-ppc64 \
|
|
wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc64 \
|
|
wcscpy-power7 wcscpy-power6 wcscpy-ppc64 \
|
|
|
|
CFLAGS-wcschr-power7.c += -mcpu=power7
|
|
CFLAGS-wcschr-power6.c += -mcpu=power6
|
|
CFLAGS-wcsrchr-power7.c += -mcpu=power7
|
|
CFLAGS-wcsrchr-power6.c += -mcpu=power6
|
|
CFLAGS-wcscpy-power7.c += -mcpu=power7
|
|
CFLAGS-wcscpy-power6.c += -mcpu=power6
|
|
endif
|