Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753858AbbHMS0o (ORCPT ); Thu, 13 Aug 2015 14:26:44 -0400 Received: from mail-io0-f179.google.com ([209.85.223.179]:33945 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753532AbbHMS0m (ORCPT ); Thu, 13 Aug 2015 14:26:42 -0400 MIME-Version: 1.0 In-Reply-To: <20150813181841.10342.qmail@ns.horizon.com> References: <20150813181841.10342.qmail@ns.horizon.com> Date: Thu, 13 Aug 2015 11:26:30 -0700 X-Google-Sender-Auth: vdsbhKrLLl7ufgeDN6_ii0cDb6A Message-ID: Subject: Re: enabling libgcc for 64-bit divisions, was Re: PROBLEM: XFS on ARM corruption 'Structure needs cl From: Linus Torvalds To: George Spelvin Cc: akpm@linux.foundation.org, Christoph Hellwig , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List , Andrew Lutomirski Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 977 Lines: 24 On Thu, Aug 13, 2015 at 11:18 AM, George Spelvin 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 . 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/