Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932073AbdLTQSU (ORCPT ); Wed, 20 Dec 2017 11:18:20 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:34456 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754377AbdLTQSM (ORCPT ); Wed, 20 Dec 2017 11:18:12 -0500 X-Google-Smtp-Source: ACJfBouUGYqkVBVbpx93Dm0HqyYKtkecCnB0gQmSKUw2z4RZk0uA4zR006TOPrZ3TtQLtwaTiNwg1t6/HHcCp16eumw= MIME-Version: 1.0 In-Reply-To: <20171220160001.manjff26gfbjccsw@hirez.programming.kicks-ass.net> References: <20171220142001.18161-1-cmo@melexis.com> <1c1d0ffa8ee140bf9adbc78f1559b1e8@AcuMS.aculab.com> <20171220160001.manjff26gfbjccsw@hirez.programming.kicks-ass.net> From: Crt Mori Date: Wed, 20 Dec 2017 17:17:29 +0100 Message-ID: Subject: Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt To: Peter Zijlstra Cc: David Laight , 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 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: 535 Lines: 13 On 20 December 2017 at 17:00, Peter Zijlstra wrote: > 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. OK, is there any more easy optimizations you see?