Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755718AbbBCE5W (ORCPT ); Mon, 2 Feb 2015 23:57:22 -0500 Received: from smtp2.provo.novell.com ([137.65.250.81]:41974 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751864AbbBCE5V (ORCPT ); Mon, 2 Feb 2015 23:57:21 -0500 Message-ID: <1422939437.2293.6.camel@stgolabs.net> Subject: Re: [PATCH] lib/int_sqrt.c: Optimize square root function From: Davidlohr Bueso To: Linus Torvalds Cc: Anshul Garg , Linux Kernel Mailing List , anshul.g@samsung.com Date: Mon, 02 Feb 2015 20:57:17 -0800 In-Reply-To: <1422938501.2293.1.camel@stgolabs.net> References: <1422897162-111998-1-git-send-email-aksgarg1989@gmail.com> <1422938501.2293.1.camel@stgolabs.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.7 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 700 Lines: 21 On Mon, 2015-02-02 at 20:41 -0800, Davidlohr Bueso wrote: > On Mon, 2015-02-02 at 11:13 -0800, Linus Torvalds wrote: > > IOW, instead of > > > > m = 1UL << (BITS_PER_LONG - 2); > > > > perhaps something like > > > > m = 1UL << (BITS_PER_LONG/2- 2); > > if (m < x) > > m <<= BITS_PER_LONG/2; Assuming small values mostly, we could also try more aggressive estimators for BITS_PER_LONG == 64. But then again, it probably doesn't matter. -- 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/