From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752118AbcBBAgn (ORCPT ); Mon, 1 Feb 2016 19:36:43 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:35390 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751361AbcBBAgl (ORCPT ); Mon, 1 Feb 2016 19:36:41 -0500 Message-ID: <1454373398.7627.193.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: [PATCH] Optimize int_sqrt for small values for faster idle From: Eric Dumazet To: Rasmus Villemoes Cc: Andi Kleen , Andi Kleen , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, davidlohr.bueso@hp.com, rafael.j.wysocki@intel.com, lenb@kernel.org Date: Mon, 01 Feb 2016 16:36:38 -0800 In-Reply-To: <87powgav0h.fsf@rasmusvillemoes.dk> References: <1454017365-8509-1-git-send-email-andi@firstfloor.org> <87y4b4azsy.fsf@rasmusvillemoes.dk> <20160201213622.GA15302@tassilo.jf.intel.com> <87powgav0h.fsf@rasmusvillemoes.dk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 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 On Tue, 2016-02-02 at 00:08 +0100, Rasmus Villemoes wrote: > Thanks. (Is there a good way to tell gcc that avg*avg is actually a > 32x32->64 multiplication?) If avg is 32bit, compiler does that for you. u32 avg = ... u64 result = (u64)avg * avg;