This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Gcc builtin review: strpbrk, strspn, strcspn
- 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 20:16:52 +0200
- Subject: Gcc builtin review: strpbrk, strspn, strcspn
- Authentication-results: sourceware.org; auth=none
- References: <20150525101505 dot GA11233 at domone> <20150525114545 dot GC11233 at domone> <20150525115830 dot GD11233 at domone>
These do relatively good job.
These would be typical use-case for ufuncs. In most use cases accept
argument is consant so you want to precompute it as array as one
implementation computes table with characters and then checks if each
character is in table.
But on x64 there is better implementation which is only case where
sse4.2 instructions are useful in glibc string function.
So you need to do resolving if to expand table based on if cpu uses
sse4.2 which gcc cannot do.