This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Gcc builtin review: strstr, strcasestr, memmem
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: libc-alpha at sourceware dot org
- Cc: Andrew Pinski <pinskia at gmail dot com>
- Date: Mon, 25 May 2015 21:15:10 +0200
- Subject: Re: Gcc builtin review: strstr, strcasestr, memmem
- Authentication-results: sourceware.org; auth=none
- References: <20150525101505 dot GA11233 at domone> <20150525114545 dot GC11233 at domone> <20150525190923 dot GA19331 at domone>
On Mon, May 25, 2015 at 09:09:23PM +0200, OndÅej BÃlka wrote:
> A gcc does little optimizations, just constant arguments.
>
> And why gcc doesnt optimize memmem as arguments are constant and with
> size 1 needle it could use memchr?
>
Forgot to add that these could be candidate to ufunc pattern. While I
added heuristic to delay critical factorization as far as possible it
could be possible to get faster algorithm when you don't have to spend
90% of strstr time to recompute factorization again which was previously
case of small haystacks.
This is also quite unsuitable for gcc pass and as implementation could
change it could easily become obsolete and cause problems.