This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH v2 00/16] Improve generic string routines
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-alpha at sourceware dot org
- Date: Wed, 21 Dec 2016 15:05:49 -0800
- Subject: [PATCH v2 00/16] Improve generic string routines
- Authentication-results: sourceware.org; auth=none
The idea here was to improve hppa performance without going all
the way to hand-written assembly (at least for now) so that other
minor architectures could benefit.
Changes since v1:
* Marked ChangeLog entries with [BZ #5806], as appropriate.
* Reorganized the headers, so that armv6t2 and power6 need override
as little as possible to use their (integer) zero detection insns.
* Hopefully fixed all of the coding style issues.
* Adjusted the memrchr algorithm as discussed.
* Replaced the #ifdef STRRCHR etc that are used by the multiarch files.
* Tested on i386, i686, x86_64 (verified this is unused), ppc64,
ppc64le --with-cpu=power8 (to use power6 in multiarch), armv7,
aarch64, alpha (qemu) and hppa (qemu).
As for the rest of #5806... I see two schools of thought: either let
sleeping dogs lie, or remove the files entirely. The "new" zero test
is objectively better, requiring only one branch per test instead of two.
For i686, it's possible that the unrolling done is significant, but
it's also code that's essentially unused except for ld.so startup.
After that we'll use the sse2 version for all but the barest fraction
of hw still running.
For m68k, there's no unrolling done and the compiler generated version
looks better to me; however I can't benchmark it.
r~
Richard Henderson (16):
Parameterize op_t from memcopy.h
Parameterize OP_T_THRES from memcopy.h
Improve generic strlen
Improve generic strchr
Improve generic memchr
Improve generic strchrnul
Improve generic strrchr
Improve generic memrchr
Improve generic strnlen
Improve generic strcmp
hppa: Add memcopy.h
hppa: Add string-fzb.h and string-fzi.h
alpha: Add string-fzb.h and string-fzi.h
arm: Add string-fza.h
arm: Define __memchr
powerpc: Add string-fza.h
string/memchr.c | 146 ++++++------------
string/memrchr.c | 205 +++++++-------------------
string/strchr.c | 164 ++++-----------------
string/strchrnul.c | 142 +++---------------
string/strcmp.c | 102 +++++++++++--
string/strlen.c | 89 +++--------
string/strnlen.c | 133 +----------------
string/strrchr.c | 76 ++++++++--
sysdeps/alpha/string-fza.h | 1 +
sysdeps/alpha/string-fzb.h | 51 +++++++
sysdeps/alpha/string-fzi.h | 106 +++++++++++++
sysdeps/arm/armv6t2/memchr.S | 2 +
sysdeps/arm/armv6t2/string-fza.h | 69 +++++++++
sysdeps/generic/memcopy.h | 11 +-
sysdeps/generic/string-extbyte.h | 35 +++++
sysdeps/generic/string-fza.h | 117 +++++++++++++++
sysdeps/generic/string-fzb.h | 49 ++++++
sysdeps/generic/string-fzi.h | 146 ++++++++++++++++++
sysdeps/generic/string-opthr.h | 25 ++++
sysdeps/generic/string-optype.h | 31 ++++
sysdeps/hppa/memcopy.h | 44 ++++++
sysdeps/hppa/string-fza.h | 1 +
sysdeps/hppa/string-fzb.h | 69 +++++++++
sysdeps/hppa/string-fzi.h | 129 ++++++++++++++++
sysdeps/i386/memcopy.h | 3 -
sysdeps/i386/string-opthr.h | 25 ++++
sysdeps/m68k/memcopy.h | 3 -
sysdeps/powerpc/power6/string-fza.h | 65 ++++++++
sysdeps/powerpc/powerpc32/power4/memcopy.h | 5 -
sysdeps/powerpc/powerpc32/power6/string-fza.h | 1 +
sysdeps/powerpc/powerpc64/power6/string-fza.h | 1 +
31 files changed, 1299 insertions(+), 747 deletions(-)
create mode 100644 sysdeps/alpha/string-fza.h
create mode 100644 sysdeps/alpha/string-fzb.h
create mode 100644 sysdeps/alpha/string-fzi.h
create mode 100644 sysdeps/arm/armv6t2/string-fza.h
create mode 100644 sysdeps/generic/string-extbyte.h
create mode 100644 sysdeps/generic/string-fza.h
create mode 100644 sysdeps/generic/string-fzb.h
create mode 100644 sysdeps/generic/string-fzi.h
create mode 100644 sysdeps/generic/string-opthr.h
create mode 100644 sysdeps/generic/string-optype.h
create mode 100644 sysdeps/hppa/memcopy.h
create mode 100644 sysdeps/hppa/string-fza.h
create mode 100644 sysdeps/hppa/string-fzb.h
create mode 100644 sysdeps/hppa/string-fzi.h
create mode 100644 sysdeps/i386/string-opthr.h
create mode 100644 sysdeps/powerpc/power6/string-fza.h
create mode 100644 sysdeps/powerpc/powerpc32/power6/string-fza.h
create mode 100644 sysdeps/powerpc/powerpc64/power6/string-fza.h
--
2.9.3