IA-64 strncpy
Jakub Jelinek
jakub@redhat.com
Tue Aug 21 13:44:00 GMT 2001
Hi!
Before Uli fixed strnlen, I started hacking on IA-64 strncpy because strncpy
was calling broken strnlen and I thought I might get some better results
from actually doing it all in strncpy.S.
The result is attached.
In the tarball there are results on IA-64 for the broken strncpy using
strnlen on top of memchr, the attached strncpy.S, strncpy.S using Uli's
current strnlen.c and strncpy.S using my strnlen.c.
The attached strncpy.S beats them all for small strings (or sizes) or for
aligned strings, unfortunately for some strange reason strnlen+memcpy+memset
is faster for long unaligned strings (unaligned is ((dst^src) & 0x7) != 0).
Can any IA-64 assembly hacker look into it?
As the code is not too different from strcpy.S, I'd guess strcpy.S might
have similar performance problems too.
Worst case strncpy.S could use the attached code unless it detects early
long unaligned strings, in which case it could call strnlen/memcpy/memset,
dunno.
Jakub
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strncpy.tar.bz2
Type: application/x-bzip2
Size: 8901 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-hacker/attachments/20010821/4874b3ef/attachment.bz2>
More information about the Libc-hacker
mailing list