Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965581AbdGTONp (ORCPT ); Thu, 20 Jul 2017 10:13:45 -0400 Received: from merlin.infradead.org ([205.233.59.134]:53124 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965552AbdGTONo (ORCPT ); Thu, 20 Jul 2017 10:13:44 -0400 Date: Thu, 20 Jul 2017 16:13:33 +0200 From: Peter Zijlstra To: Joe Perches Cc: Linus Torvalds , Anshul Garg , Davidlohr Bueso , Linux Kernel Mailing List , anshul.g@samsung.com, Thomas Gleixner Subject: Re: [PATCH] lib/int_sqrt.c: Optimize square root function Message-ID: <20170720141333.vqpeuzox7qusig2c@hirez.programming.kicks-ass.net> References: <1422897162-111998-1-git-send-email-aksgarg1989@gmail.com> <20170720112449.6xvc2ghaj3jh6w7l@hirez.programming.kicks-ass.net> <1500551569.14415.9.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1500551569.14415.9.camel@perches.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: 353 Lines: 14 On Thu, Jul 20, 2017 at 04:52:49AM -0700, Joe Perches wrote: > On Thu, 2017-07-20 at 13:24 +0200, Peter Zijlstra wrote: > [] > > + m = 1UL << ((fls(x) + 1) & ~1UL); > > maybe > > #if BITS_PER_LONG == 64 > m = 1UL << ((fls64(x) + 1) & ~1UL); > #else > m = 1UL << ((fls(x) + 1) & ~1UL); > #endif We do seem to have __fls() which is defined on long.