From: Sunil Pandey <skpgkp2@gmail.com>
To: Noah Goldstein <goldstein.w.n@gmail.com>
Cc: Libc-stable Mailing List <libc-stable@sourceware.org>,
Hongjiu Lu <hjl.tools@gmail.com>,
GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH v5 2/2] x86: Optimize strlen-avx2.S
Date: Wed, 5 Oct 2022 09:35:51 -0700 [thread overview]
Message-ID: <CAMAf5_e6frh=36w0ZPeZ2vr2XWJj3UDWA9ETA-da9F76L7tz4Q@mail.gmail.com> (raw)
In-Reply-To: <CAFUsyfJK0Dve6g=WTnEACy2FzjuNpJU2j-x7Sp5A6jqKYk9khw@mail.gmail.com>
On Wed, Oct 5, 2022 at 7:23 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> On Tue, Oct 4, 2022 at 6:11 PM Sunil Pandey <skpgkp2@gmail.com> wrote:
> >
> > On Tue, Oct 4, 2022 at 2:20 PM Aurelien Jarno <aurelien@aurel32.net> wrote:
> > >
> > > On 2022-09-28 06:54, Sunil Pandey via Libc-stable wrote:
> > > > Attached patch fixes BZ# 29611.
> > > >
> > > > I would like to backport it to 2.32,2.31,2.30,2.29 and 2.29. Let me know
> > > > if there is any objection.
> > >
> > > Sorry to be late on this. I have a few comments about that patch:
> > >
> > > > From 86e1d88e1a3c126597ef39165275ada7564cfce9 Mon Sep 17 00:00:00 2001
> > > > From: "H.J. Lu" <hjl.tools@gmail.com>
> > > > Date: Mon, 19 Apr 2021 10:45:07 -0700
> > > > Subject: [PATCH] x86-64: Require BMI2 for strchr-avx2.S
> > > >
> > > > Since strchr-avx2.S updated by
> > > >
> > > > commit 1f745ecc2109890886b161d4791e1406fdfc29b8
> > > > Author: noah <goldstein.w.n@gmail.com>
> > > > Date: Wed Feb 3 00:38:59 2021 -0500
> > > >
> > > > x86-64: Refactor and improve performance of strchr-avx2.S
> > > >
> > > > uses sarx:
> > > >
> > > > c4 e2 72 f7 c0 sarx %ecx,%eax,%eax
> > > >
> > > > for strchr-avx2 family functions, require BMI2 in ifunc-impl-list.c and
> > > > ifunc-avx2.h.
> > > >
> > > > (cherry picked from commit 83c5b368226c34a2f0a5287df40fc290b2b34359)
> > > > ---
> > > > sysdeps/x86_64/multiarch/ifunc-avx2.h | 4 ++--
> > > > sysdeps/x86_64/multiarch/ifunc-impl-list.c | 12 +++++++++---
> > > > 2 files changed, 11 insertions(+), 5 deletions(-)
> > >
> > > First of all 1f745ecc2109890886b161d4791e1406fdfc29b8 never got
> > > backported to 2.32 and older branches, and strchr-avx2.S in those
> > > branches do not use BMI2 instructions. So it doesn't make sense to
> > > backport it.
> > >
> > > That said the change in ifunc-avx2.h fixes:
> > >
> > > - memchr and rawmemchr, broken by the backport of acfd088a1963 ("x86:
> > > Optimize memchr-avx2.S")
> > > - strlen and strnlen, broken by the backport of aaa23c350715 ("x86:
> > > Optimize strlen-avx2.S")
> > >
> > > So the issues are fixed, but mostly by chance.
> >
> > How do you know it is a "by chance" fix, do you have any evidence to back
> > your claim?
>
> There might not be evidence about the intention of the authors but clearly
> the strchr commit message does not clarify that it also fixes memchr/strlen.
ifunc-avx2.h header file is used in many functions, so fix in ifunc-avx2.h fixes
all those functions too. It's not "by chance", I scan all the functions where
ifunc-avx2.h are used before backporting it.
Since this is a backport commit and no extra changes are made, there is no
need to modify the original author commit message.
> >
> > >
> > > NB: at this stage, I haven't verified the consistency of the ifunc
> > > selectors with ifunc-impl-list.c.
> > >
> > > --
> > > Aurelien Jarno GPG: 4096R/1DDD8C9B
> > > aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2022-10-05 16:36 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-19 23:36 [PATCH v5 1/2] x86: Optimize strlen-evex.S Noah Goldstein
2021-04-19 23:36 ` [PATCH v5 2/2] x86: Optimize strlen-avx2.S Noah Goldstein
2021-04-20 1:01 ` H.J. Lu
2022-09-25 8:19 ` Aurelien Jarno
2022-09-25 14:00 ` Noah Goldstein
2022-09-28 13:54 ` Sunil Pandey
2022-09-28 14:02 ` Darren Tristano
2022-09-28 14:42 ` Noah Goldstein
2022-09-28 14:54 ` Sunil Pandey
2022-09-28 15:00 ` Noah Goldstein
2022-09-28 18:24 ` H.J. Lu
2022-09-30 13:19 ` FUCKETY FUCK FUCK FUCK - PLEASE FUCKING REMOVE ME> Darren Tristano
2022-09-28 18:23 ` [PATCH v5 2/2] x86: Optimize strlen-avx2.S H.J. Lu
2022-09-28 19:09 ` Sunil Pandey
2022-09-28 19:23 ` H.J. Lu
2022-09-30 13:19 ` FUCKETY FUCK FUCK FUCK - PLEASE FUCKING REMOVE ME> Darren Tristano
2022-10-04 21:19 ` [PATCH v5 2/2] x86: Optimize strlen-avx2.S Aurelien Jarno
2022-10-04 21:29 ` H.J. Lu
2022-10-05 1:10 ` Sunil Pandey
2022-10-05 14:23 ` Noah Goldstein
2022-10-05 16:35 ` Sunil Pandey [this message]
2022-10-05 17:11 ` Aurelien Jarno
2022-10-05 18:34 ` Sunil Pandey
2021-04-20 1:01 ` [PATCH v5 1/2] x86: Optimize strlen-evex.S H.J. Lu
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='CAMAf5_e6frh=36w0ZPeZ2vr2XWJj3UDWA9ETA-da9F76L7tz4Q@mail.gmail.com' \
--to=skpgkp2@gmail.com \
--cc=goldstein.w.n@gmail.com \
--cc=hjl.tools@gmail.com \
--cc=libc-alpha@sourceware.org \
--cc=libc-stable@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).