Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755546AbdLTQAd (ORCPT ); Wed, 20 Dec 2017 11:00:33 -0500 Received: from merlin.infradead.org ([205.233.59.134]:47210 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755085AbdLTQAb (ORCPT ); Wed, 20 Dec 2017 11:00:31 -0500 Date: Wed, 20 Dec 2017 17:00:01 +0100 From: Peter Zijlstra To: David Laight Cc: "'Crt Mori'" , Jonathan Cameron , Ingo Molnar , Andrew Morton , Kees Cook , Rusty Russell , Ian Abbott , Larry Finger , Niklas Soderlund , Thomas Gleixner , Krzysztof Kozlowski , Masahiro Yamada , "linux-kernel@vger.kernel.org" , "linux-iio@vger.kernel.org" , Joe Perches Subject: Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt Message-ID: <20171220160001.manjff26gfbjccsw@hirez.programming.kicks-ass.net> References: <20171220142001.18161-1-cmo@melexis.com> <1c1d0ffa8ee140bf9adbc78f1559b1e8@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1c1d0ffa8ee140bf9adbc78f1559b1e8@AcuMS.aculab.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 396 Lines: 10 On Wed, Dec 20, 2017 at 02:39:26PM +0000, David Laight wrote: > With minor changes it ought to be possible to remove most of the > 64bit arithmetic and shifts. > > If you care about performance then using 32 bit maths will be much faster. Some, u64 add/sub/shift isn't exactly expensive, but yes, I also indicated that improvement is possible. At the very least y can be made a u32 I suppose.