This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 00/11] Improve generic string routines



On 17/12/2016 04:57, Richard Henderson wrote:
> 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).

Nice, this is something I already started to implement which resembles
your implementation.  The bogus comment was already reported on 
BZ#5806 [1] and these cleanup seems a step further to clean fix it
(we will still need to check on i386 and m68k memchr, strchrnul, strlen,
and rawmemchr that copied and paste the same comment on its assembly
implementation).

> 
> 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~

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=5806


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]