This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 00/11] Improve generic string routines
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-alpha at sourceware dot org
- Date: Fri, 16 Dec 2016 22:57:18 -0800
- Subject: [PATCH 00/11] 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.
The main improvement, IMO, is pulling out all of the scattered
"magic" byte tests to a new header, haszero.h.
I'll note that the comments regarding these tests are in fact out
of date -- they speak of a number 0x7efefeff which does not appear
(we use -0x01010101 or 0xfefefeff), and a test misfire which cannot
actually occur (presumably because we changed algorithms).
This header can then be easily overridden for a target to use a
cheaper zero-byte test, if one exists. I've provided such for
both hppa and alpha.
I've tested this for hppa and alpha, both under qemu. While I
cannot provide non-simulated numbers for benchmark improvements,
I'm confident that the real hardware ought to agree in magnitude.
r~
Richard Henderson (11):
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 haszero.h and whichzero.h
alpha: Add haszero.h and whichzero.h
string/memchr.c | 118 +++++++--------------------
string/memrchr.c | 180 +++++++-----------------------------------
string/strchr.c | 144 +++++----------------------------
string/strchrnul.c | 126 ++++-------------------------
string/strcmp.c | 100 +++++++++++++++++++++--
string/strlen.c | 80 ++++---------------
string/strnlen.c | 125 +++++------------------------
string/strrchr.c | 67 +++++++++++++---
sysdeps/alpha/haszero.h | 36 +++++++++
sysdeps/alpha/whichzero.h | 55 +++++++++++++
sysdeps/generic/extractbyte.h | 34 ++++++++
sysdeps/generic/haszero.h | 42 ++++++++++
sysdeps/generic/whichzero.h | 67 ++++++++++++++++
sysdeps/hppa/haszero.h | 82 +++++++++++++++++++
sysdeps/hppa/memcopy.h | 44 +++++++++++
sysdeps/hppa/whichzero.h | 70 ++++++++++++++++
16 files changed, 707 insertions(+), 663 deletions(-)
create mode 100644 sysdeps/alpha/haszero.h
create mode 100644 sysdeps/alpha/whichzero.h
create mode 100644 sysdeps/generic/extractbyte.h
create mode 100644 sysdeps/generic/haszero.h
create mode 100644 sysdeps/generic/whichzero.h
create mode 100644 sysdeps/hppa/haszero.h
create mode 100644 sysdeps/hppa/memcopy.h
create mode 100644 sysdeps/hppa/whichzero.h
--
2.9.3