IA-64 strncpy
Richard Henderson
rth@twiddle.net
Wed Aug 29 15:32:00 GMT 2001
On Tue, Aug 21, 2001 at 10:46:30PM +0200, Jakub Jelinek wrote:
> 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?
(p5) ld1 c = [src], 1 // c = *src++
;;
st1 [dest] = c, 1 // *dest++ = c
IA-64 won't write-combine smaller than 8 (or 4) bytes. You'll
get something like a 6 cycle stall writing to sequential bytes
like this.
If you want to quickly copy unaligned data, you have to play
word shifting games.
r~
More information about the Libc-hacker
mailing list