ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: ksummit-discuss@lists.linuxfoundation.org
Subject: Re: [Ksummit-discuss] [TECH TOPIC] Compiler shopping list
Date: Sat, 23 Jul 2016 16:09:34 -0700	[thread overview]
Message-ID: <20160723230932.GA31398@ast-mbp.thefacebook.com> (raw)
In-Reply-To: <1469306149.8568.209.camel@kernel.crashing.org>

On Sun, Jul 24, 2016 at 06:35:49AM +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2016-07-22 at 16:59 +0100, David Woodhouse wrote:
> > I'm not sure Linus proposed that. I certainly did, many times.
> > 
> > With the work I put in to make use of __builtin_bswapXX() we do have
> > a
> > *certain* amount of the functionality that full endianness
> > attribution
> > would give us — the compiler can see and optimise certain
> > load/mask/save operations, and can use movbe and equivalent
> > instructions.

both llvm and gcc already optimize load + builtin_bswap into movbe on x64.

> > But a full implementation that let us just do assignment without
> > jumping through the hoops might still be nice.
> 
> One advantage of that is it might allow to work around a limitation
> with the current __biultin_bswap* and READ_ONCE/ACCESS_ONCE (such
> as used in gup).
> 
> The ACCESS_ONCE magic pretty much forces the compiler to separate
> the load from the swap, it thus prevents us from using the byteswapped-
> load instructions that we have on powerpc, thus degrading to a load
> followed by the 5 or 6 instructions (with back-to-back dependencies)
> needed to do the swap.

yeah, looks like volatile somehow preventing gcc to optimize it,
but that's a compiler missing an optimization. New 'bigendian' attribute
for a variable is not going to help this situation.

  reply	other threads:[~2016-07-23 23:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 10:41 David Howells
2016-07-22 15:52 ` Christian Borntraeger
2016-07-22 15:59   ` David Woodhouse
2016-07-22 17:05     ` Christian Borntraeger
2016-07-22 17:17       ` James Bottomley
2016-07-22 17:33         ` David Woodhouse
2016-07-29  1:16       ` Steven Rostedt
2016-07-23 20:35     ` Benjamin Herrenschmidt
2016-07-23 23:09       ` Alexei Starovoitov [this message]
2016-07-25 18:49 ` Luis R. Rodriguez
2016-07-29  1:32 ` Steven Rostedt

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=20160723230932.GA31398@ast-mbp.thefacebook.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=ksummit-discuss@lists.linuxfoundation.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