From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932623AbdGXPir (ORCPT ); Mon, 24 Jul 2017 11:38:47 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:37962 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753154AbdGXPic (ORCPT ); Mon, 24 Jul 2017 11:38:32 -0400 Message-Id: <20170724151630.447009076@infradead.org> User-Agent: quilt/0.61-1 Date: Mon, 24 Jul 2017 17:16:30 +0200 From: Peter Zijlstra To: torvalds@linux-foundation.org, akpm@linux-foundation.org Cc: dave@stgolabs.net, aksgarg1989@gmail.com, tglx@linutronix.de, mingo@kernel.org, will.deacon@arm.com, joe@perches.com, peterz@infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] lib/int_sqrt: Fix, optimize and document Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Here are a few patches that should improve things lib/int_sqrt. As stated elsewhere; I'm looking at using int_sqrt() to calculate the stdev on a normal distribution and am expecting the input values to be smallish. In any case, these optimizations should work fine for large numbers too. And if you have a find-last-set or count-leading-zeros instruction they rock ;-) I can post the tool used to generate the numbers or do a patch to add it to tools/testing/ if people care. The cold numbers are fairly sensitive to code layout (GCC version, random changes etc..), so I expect the branch predictor of my SKL is only partially confused or there's other things at play. However the general trend in the numbers seems fairly stable.