Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031899AbbKEDN7 (ORCPT ); Wed, 4 Nov 2015 22:13:59 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:40248 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031616AbbKEDNz convert rfc822-to-8bit (ORCPT ); Wed, 4 Nov 2015 22:13:55 -0500 From: Vineet Gupta To: Nicolas Pitre , =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= CC: Alexey Brodkin , "shemminger@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "linux-snps-arc@lists.infradead.org" , "rmk+kernel@arm.linux.org.uk" , "davem@davemloft.net" , "mingo@elte.hu" Subject: Re: [PATCH] __div64_32: implement division by multiplication for 32-bit arches Thread-Topic: [PATCH] __div64_32: implement division by multiplication for 32-bit arches Thread-Index: AQHREzq+SwFbjrpznUehjrPpNz4IFQ== Date: Thu, 5 Nov 2015 03:13:49 +0000 Message-ID: References: <1446072455-16074-1-git-send-email-abrodkin@synopsys.com> <1446220442.4394.42.camel@synopsys.com> Accept-Language: en-US, en-IN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.12.197.182] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1623 Lines: 45 On Thursday 05 November 2015 05:18 AM, Nicolas Pitre wrote: > On Wed, 4 Nov 2015, Nicolas Pitre wrote: > >> On Fri, 30 Oct 2015, M?ns Rullg?rd wrote: >> >>> Nicolas Pitre writes: >>> >>>> I'm going to do it anyway given that I already have it for ARM. It'll >>>> be opt-in, so if your arch doesn't provide it then the current C >>>> implementation will be used by default. >>> Great. I'll try it out on MIPS once you've posted the patch. >> You should have seen the patches by now. >> >> I've put them along with a bunch of do_div() usage fixes here: >> >> http://git.linaro.org/people/nicolas.pitre/linux.git > More precisely: > > http://git.linaro.org/people/nicolas.pitre/linux.git div64 Hi Nico, While we are current on the topic I was wondering about another optimization in this area. The slowpath __div64_32() generates both quotient and remainder. The more general use case in kernel only cares about quotient. git grep "\sdo_div(" | wc -l 841 git grep "=\sdo_div(" | wc -l 116 Is it possible to optimize the code, if remainder was *not* needed explicitly. I understand that the hand divide will still need some sort of running tally of remainder but can the code be any better in this case. That way we can introduce another API do_div_norem() and start proliferating it for the cases where remainder is not used. Thx, -Vineet -- 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/