From: "Christoph Müllner" <cmuellner@gcc.gnu.org>
To: GNU C Library <libc-alpha@sourceware.org>,
GCC Development <gcc@gcc.gnu.org>
Cc: Noah Goldstein <goldstein.w.n@gmail.com>,
Florian Weimer <fweimer@redhat.com>,
Joseph Myers <joseph@codesourcery.com>
Subject: Re: [libc-coord] Add new ABI '__memcmpeq()' to libc
Date: Wed, 22 Sep 2021 19:46:33 +0200 [thread overview]
Message-ID: <CAHB2gtRi03WYPGRVmW=q0X=sm9a9AksNxvH6aT9JR-5=fDLXKw@mail.gmail.com> (raw)
In-Reply-To: <CAFUsyfLO2qNy2hcvio4SAY3Jw+xovKrrhidb3f8Uz4KjOsmjNQ@mail.gmail.com>
Would it make sense to extend this proposal to include __strcmpeq()
and __strncmpeq()?
Both are already available internally in GCC in form of
BUILT_IN_STRCMP_EQ and BUILT_IN_STRNCMP_EQ
(tree-ssa-strlen.c detects them in handle_builtin_string_cmp() and
builtins.c tries to inline them in expand_builtin_memcmp()).
However, they are currently restricted to cases where the length of
the string or the size of the array (of both arguments) is known.
A use case for strcmpeq() would be the comparison of std::type_info
objects (equality and inequality operator) in libstdc++.
On Tue, Sep 21, 2021 at 9:54 PM Noah Goldstein via Gcc <gcc@gcc.gnu.org> wrote:
>
> On Fri, Sep 17, 2021 at 9:27 AM Florian Weimer via Libc-alpha <
> libc-alpha@sourceware.org> wrote:
>
> > * Joseph Myers:
> >
> > > I was supposing a build-time decision (using
> > GCC_GLIBC_VERSION_GTE_IFELSE
> > > to know if the glibc version on the target definitely has this
> > function).
> > > But if we add a header declaration, you could check for __memcmpeq being
> > > declared (and so cover arbitrary C libraries, not just glibc, and avoid
> > > issues of needing to disable this logic for freestanding compilations,
> > > which would otherwise be an issue if a glibc-target toolchain is used
> > for
> > > a freestanding kernel compilation). The case of people calling
> > > __builtin_memcmp (or declaring memcmp themselves) without string.h
> > > included probably isn't one it's important to optimize.
> >
> > The header-less case looks relevant to C++ and other language front
> > ends, though. So a GCC_GLIBC_VERSION_GTE_IFELSE check could still make
> > sense for them.
> >
> > (Dropping libc-coord.)
> >
> > Thanks,
> > Florian
> >
> >
> What are we going with?
>
> Should I go forward with the proposal in GLIBC?
>
> If I should go forward with it should I include a def in string.h?
next prev parent reply other threads:[~2021-09-22 17:46 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-16 17:02 Noah Goldstein
2021-09-16 17:55 ` [libc-coord] " Chris Kennelly
2021-09-16 18:31 ` Noah Goldstein
2021-09-16 20:32 ` Chris Kennelly
2021-09-16 20:35 ` Joseph Myers
2021-09-16 20:55 ` enh
2021-09-17 7:43 ` Richard Biener
2021-09-17 8:08 ` Florian Weimer
2021-09-17 8:31 ` Richard Biener
2021-09-17 8:37 ` Florian Weimer
2021-09-17 9:30 ` Richard Biener
2021-09-17 17:40 ` Noah Goldstein
2021-09-17 9:12 ` Jakub Jelinek
2021-09-17 16:55 ` Martin Sebor
2021-09-17 14:19 ` Joseph Myers
2021-09-17 14:26 ` Florian Weimer
2021-09-21 19:53 ` Noah Goldstein
2021-09-22 17:46 ` Christoph Müllner [this message]
2021-09-22 18:15 ` Noah Goldstein
2021-09-16 21:27 ` James Y Knight
2021-09-16 21:42 ` Joseph Myers
2021-09-16 21:50 ` enh
2021-09-16 21:59 ` Noah Goldstein
2021-09-16 22:17 ` Chris Kennelly
2021-09-16 22:36 ` Joseph Myers
2021-09-16 23:24 ` Noah Goldstein
2021-09-18 1:36 ` James Y Knight
2021-10-26 22:47 ` Noah Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHB2gtRi03WYPGRVmW=q0X=sm9a9AksNxvH6aT9JR-5=fDLXKw@mail.gmail.com' \
--to=cmuellner@gcc.gnu.org \
--cc=fweimer@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=goldstein.w.n@gmail.com \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).