This is the mail archive of the libc-alpha@sources.redhat.com 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] PPC optimize strncmp for PPC32/64


Steve Munroe writes:

> Currently PPC32/64 use the generic/strncmp.c implementation. This shows 
> up in a recent benchmark as 25% of the total execution. The attached asm 
> implementations give a 15-18% improvement over the generic code.

This looks great, but I wonder if we can do better in the unaligned
case than just falling back to the byte-by-byte comparison.  I
strongly suspect that doing a word-by-word comparison with unaligned
word loads on one of the strings would be faster than the byte-by-byte
code.  I suggest word-by-word (32 bit) rather than doubleword (64 bit)
because doubleword loads that are not 4-byte aligned will trap on
POWER3 (though not on POWER4).

Regards,
Paul.


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