diff options
author | Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com> | 2016-12-27 17:48:37 -0200 |
---|---|---|
committer | Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> | 2016-12-28 11:44:31 -0200 |
commit | 9314d3545e6641063b490918e2e8716556ba20db (patch) | |
tree | cc3d6518db2c0a86db8dcbb22ee44e789a0a9920 /sysdeps/powerpc/powerpc64/multiarch/strchr.c | |
parent | ffcf0f1cb77dd0d902495fd066a96784f76f2c3a (diff) | |
download | glibc-9314d3545e6641063b490918e2e8716556ba20db.tar.gz |
powerpc64: strchr/strchrnul optimization for power8
The P7 code is used for <=32B strings and for > 32B vectorized loops are used.
This shows as an average 25% improvement depending on the position of search
character. The performance is same for shorter strings.
Tested on ppc64 and ppc64le.
Diffstat (limited to 'sysdeps/powerpc/powerpc64/multiarch/strchr.c')
-rw-r--r-- | sysdeps/powerpc/powerpc64/multiarch/strchr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr.c b/sysdeps/powerpc/powerpc64/multiarch/strchr.c index e24d6b319e..2ffb1f6c5d 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/strchr.c +++ b/sysdeps/powerpc/powerpc64/multiarch/strchr.c @@ -27,11 +27,14 @@ extern __typeof (strchr) __strchr_ppc attribute_hidden; extern __typeof (strchr) __strchr_power7 attribute_hidden; +extern __typeof (strchr) __strchr_power8 attribute_hidden; # undef strchr /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle ifunc symbol properly. */ libc_ifunc_redirected (__redirect_strchr, strchr, + (hwcap2 & PPC_FEATURE2_ARCH_2_07) + ? __strchr_power8 : (hwcap & PPC_FEATURE_HAS_VSX) ? __strchr_power7 : __strchr_ppc); |