linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: palmer@sifive.com
Cc: Greg KH <gregkh@linuxfoundation.org>, linux-riscv@lists.infradead.org
Subject: Re: [GIT PULL] RISC-V Patches for the 4.20 Merge Window, Part 1
Date: Thu, 25 Oct 2018 18:12:46 -0700	[thread overview]
Message-ID: <CAHk-=wimJ+g2O7DND0XZ54XZSrY_aiVWsiyyAXL9T1+=BG9Ptg@mail.gmail.com> (raw)
Message-ID: <20181026011246.XjLoUQnL9l-PAGHbHkmMvBTVufGlk3LCtWPz4kflnek@z> (raw)
In-Reply-To: <mhng-80deacac-267f-4b3a-ac60-4e24f120d86e@palmer-si-x1c4>

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've pulled this, but I really _really_ hope that I will get a second
pull request that gets rid of this again, and fixes whatever RISC-V
code that triggered this to just do not do an insane full 64-bit
divide on a 32-bit architecture.

                Linus

_______________________________________________
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:13 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 [this message]
2018-10-26  1:12   ` Linus Torvalds
2018-10-26  1:35   ` Paul Walmsley
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='CAHk-=wimJ+g2O7DND0XZ54XZSrY_aiVWsiyyAXL9T1+=BG9Ptg@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@sifive.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).