[PATCH 2/*] Optimize generic strchrnul and strchr
Joseph Myers
joseph@codesourcery.com
Thu May 28 18:05:00 GMT 2015
On Wed, 27 May 2015, Wilco Dijkstra wrote:
> Finally first_nonzero_byte should just use __builtin_ffsl (yet another
> function that should be inlined by default in the generic string.h...).
Will GCC always inline __builtin_ffsl (or call a libgcc function) rather
than generating a call to ffsl (user namespace) on some architectures? If
it can ever call ffsl you need to do something similar to how we handle
__mempcpy calling __builtin_mempcpy (include/string.h redeclares mempcpy
with __asm__ ("__mempcpy"), so that libc-internal calls to __mempcpy
really do call that function at the assembler level if not inlined, rather
than calling mempcpy and having namespace issues).
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list