This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Flag for handling inlining of strcmp/memcmp on i386


On Tue, Sep 29, 2009 at 1:32 PM, Martin Thuresson <martint@google.com> wrote:
> Gcc currently inlines memcmp and strcmp to repz cmpsb during
> optimization. ÂSince the library call has optimizations, such as
> reading full, aligned words, it turns out that byte-by-byte
> comparison is usually slower than calling the library functions.
>
> The diagrams show performance numbers for the library
> call and the inlined version. The numbers are from a
> microbenchmark that compare buffers, (both equal and not equal
> buffers), of various lengths.
>
> http://www.ce.chalmers.se/~martin/foo/amd_opteron_call_repz.png
> http://www.ce.chalmers.se/~martin/foo/intel_core_call_repz.png

Did these microbenchmarks include aligned and unaligned addresses?
You mention that the out of line version supports aligned accesses
better but I can't tell if you tested the unaligned case.

Thanks,
Andrew Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]