public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: David Laight <David.Laight@ACULAB.COM>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	Matthias Kaehlcke <mka@chromium.org>,
	Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H . Peter Anvin" <hpa@zytor.com>,
	"x86@kernel.org" <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Manoj Gupta <manojgupta@chromium.org>,
	Tiancong Wang <tcwang@chromium.org>,
	Stephen Hines <srhines@google.com>,
	"clang-built-linux@googlegroups.com" 
	<clang-built-linux@googlegroups.com>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Subject: Re: [PATCH] lib: Add shared copy of __lshrti3 from libgcc
Date: Mon, 18 Mar 2019 15:54:54 +0100	[thread overview]
Message-ID: <20190318145454.GS6058@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <cccfcd81efcf47a9ad2ddec7219a797d@AcuMS.aculab.com>

On Mon, Mar 18, 2019 at 02:43:41PM +0000, David Laight wrote:
> From: Peter Zijlstra
> > Sent: 18 March 2019 09:14
> > On Fri, Mar 15, 2019 at 03:06:37PM -0700, Nick Desaulniers wrote:
> > > On Fri, Mar 15, 2019 at 1:54 PM Matthias Kaehlcke <mka@chromium.org> wrote:
> > > >
> > > > The compiler may emit calls to __lshrti3 from the compiler runtime
> > > > library, which results in undefined references:
> > > >
> > > > arch/x86/kvm/x86.o: In function `mul_u64_u64_shr':
> > > >   include/linux/math64.h:186: undefined reference to `__lshrti3'
> > >
> > > Looks like Clang will emit this at -Oz (but not -O2):
> > > https://godbolt.org/z/w1_2YC
> > 
> > *OMG*, what is that compiler smoking and why do we want that?
> > 
> > It doesn't even do that for "-Os".
> 
> I like the way it moves %edx to %ecx, then %cl to %ecx and finally %ecx back to %edx.
> I'm guessing this is all made worse by the prototype containing 'char' not 'int'.
> 
> I'm sure the register tracking gets worse in every version of gcc.

This is clang, no GCC on that list comes even close to generating
anything as 'brilliant' as that.

  reply	other threads:[~2019-03-18 14:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-15 20:54 [PATCH] lib: Add shared copy of __lshrti3 from libgcc Matthias Kaehlcke
2019-03-15 22:06 ` Nick Desaulniers
2019-03-15 22:08   ` hpa
2019-03-15 23:34     ` Matthias Kaehlcke
2019-03-15 23:51       ` hpa
2019-03-15 22:12   ` hpa
2019-03-15 23:47     ` Matthias Kaehlcke
2019-03-15 23:53       ` hpa
2019-03-18 16:38         ` Matthias Kaehlcke
2019-03-15 23:29   ` Matthias Kaehlcke
2019-03-18  9:14   ` Peter Zijlstra
2019-03-18 14:43     ` David Laight
2019-03-18 14:54       ` Peter Zijlstra [this message]
2019-03-18 21:31 ` Matthias Kaehlcke
2019-03-18 21:50   ` hpa
2019-03-18 22:16     ` Matthias Kaehlcke
2019-03-18 23:44       ` hpa
2019-03-18 23:52         ` Matthias Kaehlcke
2019-03-18 23:54           ` hpa
2019-03-18 23:55           ` hpa
2019-03-19 17:10             ` Matthias Kaehlcke

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=20190318145454.GS6058@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=bp@alien8.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=manojgupta@chromium.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=mingo@redhat.com \
    --cc=mka@chromium.org \
    --cc=ndesaulniers@google.com \
    --cc=srhines@google.com \
    --cc=tcwang@chromium.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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