From: "H.J. Lu" <hjl.tools@gmail.com>
To: Noah Goldstein <goldstein.w.n@gmail.com>
Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets
Date: Thu, 21 Oct 2021 13:07:15 -0700 [thread overview]
Message-ID: <CAMe9rOr7hN=RP3G18YRAR8h9EWERBs9yRXM3F_8VhWEJK228rA@mail.gmail.com> (raw)
In-Reply-To: <CAFUsyfJH8CteF-qAvZgnv_8j+7WEpzXn4-A4Z0U16YL03jKXVQ@mail.gmail.com>
On Thu, Oct 21, 2021 at 1:02 PM Noah Goldstein via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> On Thu, Oct 21, 2021 at 2:33 PM Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
> >
> >
> >
> > On 29/09/2021 12:17, Noah Goldstein via Libc-alpha wrote:
> > > No bug.
> > >
> > > This commit adds support for __memcmpeq() as a new ABI for all
> > > targets. In this commit __memcmpeq() is implemented only as an alias
> > > to the corresponding targets memcmp() implementation. __memcmpeq() is
> > > added as a new symbol starting with GLIBC_2.35 and defined in string.h
> > > with comments explaining its behavior. Basic tests that it is callable
> > > and works where added in string/tester.c
> > >
> > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc"
> > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means
> > > is shares the same specifications as memcmp() except the return value
> > > for non-equal byte sequences is any non-zero value. This is less
> > > strict than memcmp()'s return value specification and can be better
> > > optimized when a boolean return is all that is needed.
> > >
> > > __memcmpeq() is meant to only be called by compilers if they can prove
> > > that the return value of a memcmp() call is only used for its boolean
> > > value.
> > >
> >
> > Should we export memcmpeq() as a GNU extension as well?
> >
> > > All tests in string/tester.c passed. As well build succeeds on
> > > x86_64-linux-gnu target.
> >
> > This patch requires a NEWS entry for the new symbol and most likely
> > a manual entry to describe its semantic.
>
> My understanding is that since we are only exporting this symbol for
> compiler use (to optimize boolean use of 'memcmp()') we weren't
> planning to add a manual entry.
>
> >
> > I also think we should model a new testing based on test-memcmp.c
> > to check for multiple alignments and random inputs.
>
> In this patch __memcmpeq is always just memcmp which is tested.
>
> In my followup patch (once this one gets through) to add separate
> implementations for x86_64 I add tests. Would it be better to include
> those tests in this patchset?
I think we should add it now since someone can add IFUNC for
a non x86-64 target before x86-64 one is landed.
With __memcmpeq, bcmp should be an alias of __memcmpeq,
not memcmp.
--
H.J.
next prev parent reply other threads:[~2021-10-21 20:07 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-27 20:38 [PATCH v1] " Noah Goldstein
2021-09-27 20:43 ` Joseph Myers
2021-09-27 21:06 ` Noah Goldstein
2021-09-27 21:06 ` [PATCH v2] " Noah Goldstein
2021-09-27 21:52 ` Joseph Myers
2021-09-28 1:24 ` Noah Goldstein
2021-09-28 1:24 ` [PATCH v3] " Noah Goldstein
2021-09-28 8:15 ` Andreas Schwab
2021-09-28 16:47 ` Noah Goldstein
2021-09-28 8:40 ` Florian Weimer
2021-09-28 16:47 ` Noah Goldstein
2021-09-28 16:51 ` Florian Weimer
2021-09-28 16:46 ` [PATCH v4] " Noah Goldstein
2021-09-28 16:50 ` [PATCH v5] " Noah Goldstein
2021-09-28 16:53 ` [PATCH v6] " Noah Goldstein
2021-09-29 8:36 ` Florian Weimer
2021-09-29 15:17 ` Noah Goldstein
2021-09-29 8:52 ` Andreas Schwab
2021-09-29 9:18 ` Florian Weimer
2021-09-29 9:31 ` Andreas Schwab
2021-09-29 9:44 ` Florian Weimer
2021-09-28 16:57 ` [PATCH v1] " Noah Goldstein
2021-09-29 15:17 ` [PATCH v7] " Noah Goldstein
2021-09-30 19:31 ` Noah Goldstein
2021-10-11 2:33 ` Noah Goldstein
2021-10-18 14:47 ` Noah Goldstein
2021-10-21 19:28 ` H.J. Lu
2021-10-21 19:58 ` Noah Goldstein
2021-10-21 20:00 ` H.J. Lu
2021-10-21 21:04 ` Noah Goldstein
2021-10-21 20:02 ` Adhemerval Zanella
2021-10-21 20:23 ` Noah Goldstein
2021-10-21 20:26 ` Adhemerval Zanella
2021-10-21 19:33 ` Adhemerval Zanella
2021-10-21 20:01 ` Noah Goldstein
2021-10-21 20:06 ` Adhemerval Zanella
2021-10-21 21:18 ` Florian Weimer
2021-10-21 20:07 ` H.J. Lu [this message]
2021-10-21 20:11 ` Noah Goldstein
2021-10-21 22:38 ` [PATCH v8 1/3] " Noah Goldstein
2021-10-21 22:38 ` [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-21 22:52 ` H.J. Lu
2021-10-21 23:08 ` Joseph Myers
2021-10-21 23:10 ` H.J. Lu
2021-10-21 23:14 ` Joseph Myers
2021-10-21 23:39 ` Noah Goldstein
2021-10-21 23:45 ` Noah Goldstein
2021-10-22 0:19 ` Joseph Myers
2021-10-22 0:40 ` H.J. Lu
2021-10-25 16:41 ` Joseph Myers
2021-10-22 0:18 ` Joseph Myers
2021-10-21 22:38 ` [PATCH v8 3/3] String: Add tests for __memcmpeq Noah Goldstein
2021-10-21 22:57 ` H.J. Lu
2021-10-21 23:47 ` Noah Goldstein
2021-10-22 0:41 ` H.J. Lu
2021-10-22 1:01 ` Noah Goldstein
2021-10-21 22:50 ` [PATCH v8 1/3] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
2021-10-21 23:42 ` Noah Goldstein
2021-10-22 2:38 ` H.J. Lu
2021-10-22 4:04 ` Noah Goldstein
2021-10-22 5:49 ` [PATCH v9 " Noah Goldstein
2021-10-22 12:38 ` H.J. Lu
2021-10-22 16:07 ` Noah Goldstein
2021-10-22 17:19 ` Noah Goldstein
2021-10-22 17:40 ` Noah Goldstein
2021-10-22 17:44 ` H.J. Lu
2021-10-22 18:09 ` Noah Goldstein
2021-10-22 18:33 ` H.J. Lu
2021-10-22 5:49 ` [PATCH v9 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 12:44 ` H.J. Lu
2021-10-22 5:49 ` [PATCH v9 3/3] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 12:42 ` H.J. Lu
2021-10-22 16:06 ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-10-22 16:06 ` [PATCH v10 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 16:06 ` [PATCH v10 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 16:06 ` [PATCH v10 4/4] NEWS: Add item " Noah Goldstein
2021-10-22 16:12 ` H.J. Lu
2021-10-22 16:12 ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
2021-10-22 16:18 ` Noah Goldstein
2021-10-22 18:37 ` [PATCH v11 " Noah Goldstein
2021-10-22 18:37 ` [PATCH v11 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 18:37 ` [PATCH v11 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 18:37 ` [PATCH v11 4/4] NEWS: Add item " Noah Goldstein
2021-10-22 19:46 ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-10-22 19:46 ` [PATCH v12 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 19:46 ` [PATCH v12 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 19:46 ` [PATCH v12 4/4] NEWS: Add item " Noah Goldstein
2021-10-22 20:28 ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
2021-10-22 20:33 ` Noah Goldstein
2021-10-22 20:45 ` H.J. Lu
2021-10-22 21:24 ` Noah Goldstein
2021-10-22 21:23 ` [PATCH v13 " Noah Goldstein
2021-10-22 21:23 ` [PATCH v13 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 21:23 ` [PATCH v13 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 21:23 ` [PATCH v13 4/4] NEWS: Add item " Noah Goldstein
2021-10-23 23:23 ` [PATCH v13 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-10-23 23:24 ` [PATCH v14 " Noah Goldstein
2021-10-23 23:24 ` [PATCH v14 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-26 18:56 ` H.J. Lu
2021-10-23 23:24 ` [PATCH v14 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-26 18:57 ` H.J. Lu
2021-10-23 23:24 ` [PATCH v14 4/4] NEWS: Add item " Noah Goldstein
2021-10-26 18:58 ` H.J. Lu
2021-10-25 2:45 ` [PATCH v14 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-10-26 18:55 ` H.J. Lu
2021-10-26 22:29 ` 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='CAMe9rOr7hN=RP3G18YRAR8h9EWERBs9yRXM3F_8VhWEJK228rA@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=adhemerval.zanella@linaro.org \
--cc=goldstein.w.n@gmail.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).