linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Joel Stanley <joel@jms.id.au>
Cc: linuxppc-dev@lists.ozlabs.org,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH v2] powerpc/math-emu: Update macros from gmp-6.1.2
Date: Tue, 20 Nov 2018 12:20:30 -0600	[thread overview]
Message-ID: <20181120182029.GA23873@gate.crashing.org> (raw)
In-Reply-To: <CACPK8XcdMgrnUQsHH4-fHX2Cw7=zXPBhsDJUNGQJ1=hjh0P4CQ@mail.gmail.com>

On Tue, Nov 20, 2018 at 09:45:33AM +1030, Joel Stanley wrote:
> On Tue, 20 Nov 2018 at 05:24, Nick Desaulniers <ndesaulniers@google.com> wrote:
> > >
> > > The only functional change I noticed was this in udiv_qrnnd.
> > >
> > >     __r1 = (n1) % __d1;
> > >     __q1 = (n1) / __d1;
> > >
> > > Becomes this:
> > >
> > >     __q1 = (n1) / __d1;
> > >     __r1 = (n1) - __q1 * __d1;
> > >
> > > This is equivalent as it instead of calculating the remainder
> > > using modulo, it uses the result of integer division to subtract the
> > > count of 'whole' d1 from r1.
> >
> > I don't understand this; why was this functional change made?
> 
> I couldn't see why. It pre-dates GMP's mecurial history that  .

Perhaps it is to make it more likely only a single divide machine
instruction results.  Maybe for -O0, maybe for older GCC, maybe for GCC
targets that do not get this right.  It of course means exactly the same.

> AIUI the upstream source is GMP:
> 
>  https://gmplib.org/repo/gmp/file/tip/longlong.h
> 
> > If we're going to borrow implementations from GCC, let's borrow the
> > same implementation. Otherwise it's hard to have confidence in this
> > part of the patch.
> 
> I agree we should use the upstream source.
> 
> Segher, which tree contains the One True Upstream for longlong.h?

You should probably get your updates from the same place as was used to
get the file in the first place.  Or, don't worry so much about it, how
often is this updated?  Once in ten years, or twenty?

If you do not want to include bigger (maybe irrelevant) changes from
upstream, you have already forked, effectively.


Segher

  reply	other threads:[~2018-11-20 18:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14  2:44 [PATCH v2] powerpc/math-emu: Update macros from gmp-6.1.2 Joel Stanley
2018-11-19 18:53 ` Nick Desaulniers
2018-11-19 23:15   ` Joel Stanley
2018-11-20 18:20     ` Segher Boessenkool [this message]
2018-11-20 18:45       ` Nick Desaulniers
2018-11-20 20:15         ` Segher Boessenkool
2018-11-20 21:28           ` Nick Desaulniers

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=20181120182029.GA23873@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=joel@jms.id.au \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ndesaulniers@google.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).