2013-12-13 19:31:41 +00:00
|
|
|
ifeq ($(subdir),string)
|
2017-12-11 19:39:42 +00:00
|
|
|
sysdep_routines += memcpy-power8-cached memcpy-power7 memcpy-a2 memcpy-power6 \
|
|
|
|
memcpy-cell memcpy-power4 memcpy-ppc64 \
|
2017-05-18 05:51:20 +00:00
|
|
|
memcmp-power8 memcmp-power7 memcmp-power4 memcmp-ppc64 \
|
|
|
|
memset-power7 memset-power6 memset-power4 \
|
2014-07-15 16:19:09 +00:00
|
|
|
memset-ppc64 memset-power8 \
|
2017-06-21 05:25:12 +00:00
|
|
|
mempcpy-power7 mempcpy-ppc64 \
|
|
|
|
memchr-power8 memchr-power7 memchr-ppc64 \
|
2017-10-02 12:01:13 +00:00
|
|
|
memrchr-power8 memrchr-power7 memrchr-ppc64 \
|
|
|
|
rawmemchr-power7 rawmemchr-ppc64 \
|
|
|
|
strlen-power7 strlen-ppc64 \
|
2017-04-05 13:24:24 +00:00
|
|
|
strnlen-power8 strnlen-power7 strnlen-ppc64 \
|
|
|
|
strcasecmp-power7 strcasecmp_l-power7 \
|
2015-01-09 21:04:26 +00:00
|
|
|
strncase-power7 strncase_l-power7 \
|
2023-02-28 17:23:59 +00:00
|
|
|
strncmp-power8 strncmp-ppc64 \
|
2016-12-27 19:48:37 +00:00
|
|
|
strchr-power8 strchr-power7 strchr-ppc64 \
|
|
|
|
strchrnul-power8 strchrnul-power7 strchrnul-ppc64 \
|
2014-12-23 11:59:44 +00:00
|
|
|
strcpy-power8 strcpy-power7 strcpy-ppc64 stpcpy-power8 \
|
|
|
|
stpcpy-power7 stpcpy-ppc64 \
|
2017-04-18 05:58:56 +00:00
|
|
|
strrchr-power8 strrchr-power7 strrchr-ppc64 \
|
2017-04-13 05:59:20 +00:00
|
|
|
strncat-power8 strncat-power7 strncat-ppc64 \
|
2014-11-19 21:27:56 +00:00
|
|
|
strncpy-power7 strncpy-ppc64 \
|
2014-12-31 16:47:41 +00:00
|
|
|
stpncpy-power8 stpncpy-power7 stpncpy-ppc64 \
|
2018-08-16 06:42:02 +00:00
|
|
|
strcmp-power8 strcmp-power7 strcmp-ppc64 \
|
2015-01-21 12:41:46 +00:00
|
|
|
strcat-power8 strcat-power7 strcat-ppc64 \
|
2022-02-10 14:08:59 +00:00
|
|
|
memmove-power7 memmove-ppc64 wordcopy-ppc64 \
|
2016-03-14 21:40:46 +00:00
|
|
|
strncpy-power8 strstr-power7 strstr-ppc64 \
|
2016-04-25 14:11:02 +00:00
|
|
|
strspn-power8 strspn-ppc64 strcspn-power8 strcspn-ppc64 \
|
2016-06-14 09:21:16 +00:00
|
|
|
strlen-power8 strcasestr-power8 strcasestr-ppc64 \
|
|
|
|
strcasecmp-ppc64 strcasecmp-power8 strncase-ppc64 \
|
|
|
|
strncase-power8
|
2013-12-13 19:40:28 +00:00
|
|
|
|
2018-08-16 06:42:02 +00:00
|
|
|
ifneq (,$(filter %le,$(config-machine)))
|
2023-12-12 14:52:45 +00:00
|
|
|
sysdep_routines += memchr-power10 memcmp-power10 memcpy-power10 \
|
|
|
|
memmove-power10 memset-power10 rawmemchr-power9 \
|
|
|
|
rawmemchr-power10 strcmp-power9 strcmp-power10 \
|
|
|
|
strncmp-power9 strcpy-power9 stpcpy-power9 \
|
powerpc: Add optimized rawmemchr for POWER10
Reuse code for optimized strlen to implement a faster version of rawmemchr.
This takes advantage of the same benefits provided by the strlen implementation,
but needs some extra steps. __strlen_power10 code should be unchanged after this
change.
rawmemchr returns a pointer to the char found, while strlen returns only the
length, so we have to take that into account when preparing the return value.
To quickly check 64B, the loop on __strlen_power10 merges the whole block into
16B by using unsigned minimum vector operations (vminub) and checks if there are
any \0 on the resulting vector. The same code is used by rawmemchr if the char c
is 0. However, this approach does not work when c != 0. We first need to
subtract each byte by c, so that the value we are looking for is converted to a
0, then taking the minimum and checking for nulls works again.
The new code branches after it has compared ~256 bytes and chooses which of the
two strategies above will be used in the main loop, based on the char c. This
extra branch adds some overhead (~5%) for length ~256, but is quickly amortized
by the faster loop for larger sizes.
Compared to __rawmemchr_power9, this version is ~20% faster for length < 256.
Because of the optimized main loop, the improvement becomes ~35% for c != 0
and ~50% for c = 0 for strings longer than 256.
Reviewed-by: Lucas A. M. Magalhaes <lamm@linux.ibm.com>
Reviewed-by: Raphael M Zinsly <rzinsly@linux.ibm.com>
2021-05-11 20:53:07 +00:00
|
|
|
strlen-power9 strncpy-power9 stpncpy-power9 strlen-power10
|
2018-08-16 06:42:02 +00:00
|
|
|
endif
|
2013-12-13 19:40:28 +00:00
|
|
|
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
|
|
|
|
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
|
2015-01-20 20:41:38 +00:00
|
|
|
endif
|
2023-04-03 19:10:43 +00:00
|
|
|
|
|
|
|
# Called during static initialization
|
|
|
|
CFLAGS-strncmp-ppc64.c += $(no-stack-protector)
|