From: Peter Zijlstra <peterz@infradead.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
hpa@zytor.com, linux-kernel@vger.kernel.org, x86@kernel.org,
linux-kbuild@vger.kernel.org, yamada.masahiro@socionext.com,
michal.lkml@markovi.net
Subject: Re: [PATCH 2/5] x86_64, -march=native: POPCNT support
Date: Tue, 23 Jul 2019 09:20:43 +0200 [thread overview]
Message-ID: <20190723072043.GU3402@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190722211539.GA29979@avx2>
On Tue, Jul 23, 2019 at 12:15:39AM +0300, Alexey Dobriyan wrote:
> On Mon, Jul 22, 2019 at 11:12:10PM +0200, Peter Zijlstra wrote:
> > On Mon, Jul 22, 2019 at 11:27:20PM +0300, Alexey Dobriyan wrote:
> > > Detect POPCNT instruction support and inline hweigth*() functions
> > > if it is supported by CPU.
> > >
> > > Detect POPCNT at boot time and conditionally refuse to boot.
> > >
> > > Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> > > ---
> > > arch/x86/include/asm/arch_hweight.h | 24 +++++++++++++++++++
> > > arch/x86/include/asm/segment.h | 1 +
> > > arch/x86/kernel/verify_cpu.S | 8 +++++++
> > > arch/x86/lib/Makefile | 5 +++-
> > > .../drm/i915/display/intel_display_power.c | 2 +-
> > > drivers/misc/sgi-gru/grumain.c | 2 +-
> > > fs/btrfs/tree-checker.c | 4 ++--
> > > include/linux/bitops.h | 2 ++
> > > lib/Makefile | 2 ++
> > > scripts/kconfig/cpuid.c | 7 ++++++
> > > scripts/march-native.sh | 2 ++
> > > 11 files changed, 54 insertions(+), 5 deletions(-)
> >
> > *WHY* ?
> >
> > AFAICT this just adds lines and complexity and wins aboslutely nothing.
>
> If CPU is know to have POPCNT, it doesn't make sense to go through RDI.
> Additionally some CPUs (still?) have fake dependency on the destination,
> so "popcnt rax, rdi" is suboptimal.
You completely forgot to mention any of that in your Changelog, also I
doubt you can find code where this makes a measurable difference. IOW, I
still doubt it makes any kind of sense.
next prev parent reply other threads:[~2019-07-23 7:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-22 20:27 [PATCH 1/5] x86_64: -march=native support Alexey Dobriyan
2019-07-22 20:27 ` [PATCH 2/5] x86_64, -march=native: POPCNT support Alexey Dobriyan
2019-07-22 21:12 ` Peter Zijlstra
2019-07-22 21:15 ` Alexey Dobriyan
2019-07-22 21:27 ` Alexey Dobriyan
2019-07-23 7:20 ` Peter Zijlstra [this message]
2019-07-23 20:04 ` Alexey Dobriyan
2019-07-22 20:27 ` [PATCH 3/5] x86_64, -march=native: REP MOVSB support Alexey Dobriyan
2019-07-22 20:27 ` [PATCH 4/5] x86_64, -march=native: REP STOSB support Alexey Dobriyan
2019-07-22 20:27 ` [PATCH 5/5] x86_64, -march=native: MOVBE support Alexey Dobriyan
-- strict thread matches above, loose matches on Subject: below --
2019-07-04 20:47 [PATCH 1/5] x86_64: -march=native support Alexey Dobriyan
2019-07-04 20:47 ` [PATCH 2/5] x86_64, -march=native: POPCNT support Alexey Dobriyan
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=20190723072043.GU3402@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=adobriyan@gmail.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yamada.masahiro@socionext.com \
/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 NNTP newsgroup(s).