This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC PATCH] Add strcmp, strncmp, memcmp inline implementation.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Alexander Monakov <amonakov at ispras dot ru>, libc-alpha at sourceware dot org
- Date: Fri, 29 May 2015 00:19:35 +0200
- Subject: Re: [RFC PATCH] Add strcmp, strncmp, memcmp inline implementation.
- Authentication-results: sourceware.org; auth=none
- References: <20150525015826 dot GA29445 at domone> <alpine dot DEB dot 2 dot 10 dot 1505281619080 dot 16930 at digraph dot polyomino dot org dot uk> <alpine dot LNX dot 2 dot 11 dot 1505281939550 dot 19145 at monopod dot intra dot ispras dot ru> <alpine dot DEB dot 2 dot 10 dot 1505282105020 dot 10508 at digraph dot polyomino dot org dot uk>
On Thu, May 28, 2015 at 09:06:19PM +0000, Joseph Myers wrote:
> On Thu, 28 May 2015, Alexander Monakov wrote:
>
> > On Thu, 28 May 2015, Joseph Myers wrote:
> > > On Mon, 25 May 2015, OndÅej BÃlka wrote:
> > >
> > > > Hi,
> > > >
> > > > I just found that on x64 gcc __builtin_strcmp suck a lot. And by lot I
> > > > mean its around three times slower than libcall by using rep cmpsb which
> > > > even intel manual says that shouldn't be used.
> > >
> > > GCC bug report number? It's not helpful to say "suck a lot" without
> > > reporting the issues to the other project (identifying the compiler
> > > options etc. in use). We need to cooperate appropriately with other free
> > > software projects in developing glibc.
> >
> > I think this report should serve well:
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
>
> Thanks, that's a report for one specific issue with memcmp. Each other
> issue with each function should also have bugs filed (with a meta-bug
> depending on them all).
>
strcmp/strncmp would be duplicates of that bug. Its result of correct
transformantion strcmp(s, c) -> memcmp (s, c, strlen(c) + 1) when c is
string literal.