This is the mail archive of the
mailing list for the libc-ports project.
Re: [ARM] Optimised strchr and strlen
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: "Dr. David Alan Gilbert" <david dot gilbert at linaro dot org>
- Cc: libc-ports at sourceware dot org, patches at linaro dot org
- Date: Tue, 20 Dec 2011 23:07:29 +0000 (UTC)
- Subject: Re: [ARM] Optimised strchr and strlen
- References: <20111219172122.GA10120@davesworkthinkpad>
On Mon, 19 Dec 2011, Dr. David Alan Gilbert wrote:
> +@ A very simple strchr routine, from benchmarks on A9 it's a bit faster than
> +@ the current version in eglibc.
> +@ While I have a version that does 8 bytes/loop and is a lot faster on long
> +@ strings, it is slower on short strings, and short strings seem more common
> +@ in strchr usage.
That sounds like a possible case for a hybrid function, with an unrolled
initial part testing some number of characters to cover short strings (it
might be possible to get things aligned at the same time) and the more
complicated version for longer strings. What's the actual size
distribution you see in strchr use?
Joseph S. Myers