[Bug target/27077] [x86, 4.1] builtin strlen poor performance
var at schellong dot biz
gcc-bugzilla@gcc.gnu.org
Tue Sep 27 10:26:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27077
--- Comment #10 from Helmut Schellong <var at schellong dot biz> ---
(In reply to Thomas Koenig from comment #9)
> Please see https://gcc.gnu.org/bugs/#need for the things that
> are required for a bug report.
>
> Specifically,
>
> the preprocessed file (*.i*) that triggers the bug, generated by adding
> -save-temps to the complete compilation command, or, in the case of a bug
> report for the GNAT front end, a complete set of source files (see below).
In this case a lot of informations are not necessary.
This can be shortened to:
"Change each builtin that implements string instructions."
That's almost enough.
Example:
The strlen() in (my) libc reads eight bytes and realizes a zero byte
therein at a single blow.
scasb cannot be so fast (bytewise).
This C code (translated):
while (*s) ++s;
return (s-s0);
runs three times faster than the scasb-builtin.
This says all-inclusive.
More information about the Gcc-bugs
mailing list