All of lore.kernel.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Michael Cree <mcree@orcon.net.nz>, George Spelvin <lkml@sdf.org>,
	linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org,
	linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: CONFIG_ARCH_SUPPORTS_INT128: Why not mips, s390, powerpc, and alpha?
Date: Sat, 30 Mar 2019 18:14:03 -0500	[thread overview]
Message-ID: <20190330231402.GM3969@gate.crashing.org> (raw)
In-Reply-To: <20190329200015.ujmjrvn6ta67h74j@tower>

On Sat, Mar 30, 2019 at 09:00:15AM +1300, Michael Cree wrote:
> It does move the umulh inside the loop but that seems sensible since
> the use of unlikely() implies that the loop is unlikely to be taken
> so on average it would be a good bet to start the calculation of
> umulh earlier since it has a few cycles latency to get the result,
> and it is pipelined so it can be calculated in the shadow of the
> mulq instruction on the same execution unit.

That may make sense, but it is not what happens, sorry.  It _starts off_
as part of the loop, and it is never moved outside.

The only difference between a likely loop and an unlikely loop here I've
seen (on all targets I tried) is that with a likely loop the loop target
is aligned, while with an unlikely loop it isn't.

> On the older CPUs
> (before EV6 which are not out-of-order execution) having the umulh
> inside the loop may be a net gain.

Yes.  Similarly, on Power you can often calculate the high mul at the same
time as the low mul, for no extra cost.  This may be true on many archs.


Segher

  reply	other threads:[~2019-03-30 23:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29 13:07 CONFIG_ARCH_SUPPORTS_INT128: Why not mips, s390, powerpc, and alpha? George Spelvin
2019-03-29 20:00 ` Michael Cree
2019-03-29 20:00   ` Michael Cree
2019-03-30 23:14   ` Segher Boessenkool [this message]
2019-03-29 20:25 ` Segher Boessenkool
2019-03-29 20:25   ` Segher Boessenkool
2019-03-30 11:28   ` George Spelvin
2019-03-30 11:28     ` George Spelvin
2019-03-30 23:52     ` Segher Boessenkool
2019-03-30 23:52       ` Segher Boessenkool
2019-03-30  8:43 ` Heiko Carstens
2019-03-30  8:43   ` Heiko Carstens
2019-03-30 10:30   ` George Spelvin
2019-03-30 10:30     ` George Spelvin
2019-03-30 13:00     ` George Spelvin
2019-03-30 13:00       ` George Spelvin
2019-03-31  0:30     ` Segher Boessenkool
2019-03-31  0:30       ` Segher Boessenkool
2019-03-31  9:23       ` George Spelvin

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=20190330231402.GM3969@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lkml@sdf.org \
    --cc=mcree@orcon.net.nz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.