Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752658AbdLUOMP (ORCPT ); Thu, 21 Dec 2017 09:12:15 -0500 Received: from merlin.infradead.org ([205.233.59.134]:58348 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752222AbdLUOMI (ORCPT ); Thu, 21 Dec 2017 09:12:08 -0500 Date: Thu, 21 Dec 2017 15:11:30 +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: <20171221141130.cdng2mysnjj6j4i6@hirez.programming.kicks-ass.net> References: <20171220142001.18161-1-cmo@melexis.com> <1c1d0ffa8ee140bf9adbc78f1559b1e8@AcuMS.aculab.com> <20171220160001.manjff26gfbjccsw@hirez.programming.kicks-ass.net> <95b9b2b52554410a85a9f10c7f5e8b13@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 274 Lines: 8 On Thu, Dec 21, 2017 at 01:56:55PM +0000, David Laight wrote: > > This part above looks like FLS > It also does the rest of the required shifts. Still, fls() + shift is way faster on hardware that has an fls instruction. Writing out that binary search doesn't make sense.