linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Paul Walmsley <paul.walmsley@sifive.com>
To: zongbox@gmail.com
Cc: Greg KH <gregkh@linuxfoundation.org>,
	linux-riscv@lists.infradead.org, palmer@sifive.com,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [GIT PULL] RISC-V Patches for the 4.20 Merge Window, Part 1
Date: Thu, 25 Oct 2018 18:35:38 -0700	[thread overview]
Message-ID: <41b34e47-57de-bcc1-c86e-8b98f663367a@sifive.com> (raw)
Message-ID: <20181026013538.5ybxxceCgw48kOUUNC4bvsYm6ErLxCxL6gCs1JYqehA@z> (raw)
In-Reply-To: <CAHk-=wimJ+g2O7DND0XZ54XZSrY_aiVWsiyyAXL9T1+=BG9Ptg@mail.gmail.com>

+ Zong Li

Zong,

On 10/25/18 6:12 PM, Linus Torvalds wrote:
> On Wed, Oct 24, 2018 at 1:42 PM Palmer Dabbelt <palmer@sifive.com> wrote:
>> I'm pretty sure this is our largest patch set since the original kernel
>> contribution, and it's certainly the one with the most contributors.
>> While I don't have anything else I know I'm going to submit for the
>> merge window, I would be somewhat surprised if I didn't screw anything
>> up.
> So I'm not entirely sure this is a screw-up, but it does have some
> signs of being one:
>
>>        lib: Add umoddi3 and udivmoddi4 of GCC library routines
> We have *actively* tried to avoid needing umoddi3 and friends, and
> have so far succceeded in doing that across many different
> architectures, and many many years.
>
> And when we _have_ added it, we've added it as architecture-specific
> optimized routines when people really need it.
>
> The reason to avoid a full 64-by-64 divide is that
>
>   (a) it is really expensive
>
>   (b) code that needs it is almost always actually wrong
>
> Almost always, the 64-bit divide turns out to be entirely pointless,
> and the code can be written as a (much cheaper) 64-by-32 divide
> instead using the functions in <asm/div.h> instead.
>
> Does RISC-V _really_ need that disgusting full 64-bit divide, or was
> the addition of that simply a "we didn't know better, and didn't
> realize just how expensive and wrong it is"?


I believe the request for those routines came from you:


https://lore.kernel.org/lkml/779b0b25cc96101a525402f38053db5e2f360d6f.1538535528.git.zongbox@gmail.com/


Do you in fact need a full 64-by-64 bit divide in your DMA driver, or 
can you

get away with using div_u64() et al.?


https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/math64.h#n123


- Paul


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2018-10-26  1:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24 20:42 [GIT PULL] RISC-V Patches for the 4.20 Merge Window, Part 1 Palmer Dabbelt
2018-10-24 20:42 ` Palmer Dabbelt
2018-10-26  1:12 ` Linus Torvalds
2018-10-26  1:12   ` Linus Torvalds
2018-10-26  1:35   ` Paul Walmsley [this message]
2018-10-26  1:35     ` Paul Walmsley
2018-10-26  1:51     ` Linus Torvalds
2018-10-26  1:51       ` Linus Torvalds
2018-10-26 16:13       ` Zong Li
2018-10-26 16:13         ` Zong Li
2018-10-26 16:19     ` Zong Li
2018-10-26 16:19       ` Zong Li
2018-10-26 19:32   ` Palmer Dabbelt
2018-10-26 19:32     ` Palmer Dabbelt

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=41b34e47-57de-bcc1-c86e-8b98f663367a@sifive.com \
    --to=paul.walmsley@sifive.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@sifive.com \
    --cc=torvalds@linux-foundation.org \
    --cc=zongbox@gmail.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).