linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Albert Cahalan <acahalan@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: arch/powerpc/*/div64.S
Date: Thu, 18 Nov 2010 14:37:14 +1100	[thread overview]
Message-ID: <1290051434.32570.0.camel@pasglop> (raw)
In-Reply-To: <AANLkTinC-DiZNZ4GsWM2+xk+mp=AN1Q82uLAekNB=_FT@mail.gmail.com>

On Sat, 2010-10-02 at 14:16 -0400, Albert Cahalan wrote:
> This looks like duplicated code getting out of sync.

Right, tho your patch actually reverts the fix :-)

I don't know if it's worth considering using common files for some /lib
stuff there tho.. .the runtime env. is quite different...

Ben.

> $ diff -Naurd arch/powerpc/lib/div64.S arch/powerpc/boot/div64.S
> --- arch/powerpc/lib/div64.S    2009-09-09 18:13:59.000000000 -0400
> +++ arch/powerpc/boot/div64.S   2009-09-09 18:13:59.000000000 -0400
> @@ -13,10 +13,10 @@
>   * as published by the Free Software Foundation; either version
>   * 2 of the License, or (at your option) any later version.
>   */
> -#include <asm/ppc_asm.h>
> -#include <asm/processor.h>
> +#include "ppc_asm.h"
> 
> -_GLOBAL(__div64_32)
> +       .globl __div64_32
> +__div64_32:
>         lwz     r5,0(r3)        # get the dividend into r5/r6
>         lwz     r6,4(r3)
>         cmplw   r5,r4
> @@ -33,10 +33,9 @@
>         cntlzw  r0,r5           # we are shifting the dividend right
>         li      r10,-1          # to make it < 2^32, and shifting
>         srw     r10,r10,r0      # the divisor right the same amount,
> -       addc    r9,r4,r10       # rounding up (so the estimate cannot
> +       add     r9,r4,r10       # rounding up (so the estimate cannot
>         andc    r11,r6,r10      # ever be too large, only too small)
>         andc    r9,r9,r10
> -       addze   r9,r9
>         or      r11,r5,r11
>         rotlw   r9,r9,r0
>         rotlw   r11,r11,r0
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

      reply	other threads:[~2010-11-18  3:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-02 18:16 arch/powerpc/*/div64.S Albert Cahalan
2010-11-18  3:37 ` Benjamin Herrenschmidt [this message]

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=1290051434.32570.0.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=acahalan@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).