From: Linus Torvalds <torvalds@linux-foundation.org>
To: George Spelvin <linux@horizon.com>
Cc: akpm@linux.foundation.org, Christoph Hellwig <hch@infradead.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Lutomirski <luto@kernel.org>
Subject: Re: enabling libgcc for 64-bit divisions, was Re: PROBLEM: XFS on ARM corruption 'Structure needs cl
Date: Thu, 13 Aug 2015 11:26:30 -0700 [thread overview]
Message-ID: <CA+55aFw9-sN0nHn-ohdhSEt9i-mUjXN3fBj+dXLg56jgsOwgDw@mail.gmail.com> (raw)
In-Reply-To: <20150813181841.10342.qmail@ns.horizon.com>
On Thu, Aug 13, 2015 at 11:18 AM, George Spelvin <linux@horizon.com> wrote:
>
> On x86, the case that msword >= divsor causes a divide exception
> (divide ba generalization of divide by zero), so it's tempting
> to do the same sort of "assume no trap and fix up in the handler"
> trick as <asm/uaccess.h>.
That would be horrible. One of the reasonably common cases of do_div()
is for printing out numbers. And they are often in the 4G+ range..
> One function that would cover a significant number of use cases
> (but not all, damn it) would be
>
> rem = do_mul_div(x, mul,_div)
Yes. That might be worth introducing. Not to replace do_div(), but as
a "32-bit only" interface to a somewhat common situation.
Linus
next prev parent reply other threads:[~2015-08-13 18:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-13 6:11 enabling libgcc for 64-bit divisions, was Re: PROBLEM: XFS on ARM corruption 'Structure needs cl George Spelvin
2015-08-13 16:28 ` Linus Torvalds
2015-08-13 18:18 ` George Spelvin
2015-08-13 18:26 ` Linus Torvalds [this message]
2015-08-13 19:09 ` 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=CA+55aFw9-sN0nHn-ohdhSEt9i-mUjXN3fBj+dXLg56jgsOwgDw@mail.gmail.com \
--to=torvalds@linux-foundation.org \
--cc=akpm@linux.foundation.org \
--cc=hch@infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@horizon.com \
--cc=luto@kernel.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).