Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751395AbbLMABY (ORCPT ); Sat, 12 Dec 2015 19:01:24 -0500 Received: from mail-qk0-f172.google.com ([209.85.220.172]:35617 "EHLO mail-qk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751187AbbLMABW (ORCPT ); Sat, 12 Dec 2015 19:01:22 -0500 MIME-Version: 1.0 In-Reply-To: <20151204201901.GB19430@google.com> References: <1448874894-18398-1-git-send-email-mst@redhat.com> <20151204201901.GB19430@google.com> Date: Sun, 13 Dec 2015 02:01:22 +0200 Message-ID: Subject: Re: [PATCH v2] vhost: replace % with & on data path From: Andy Shevchenko To: Venkatesh Srinivas Cc: "Michael S. Tsirkin" , "linux-kernel@vger.kernel.org" , netdev , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1130 Lines: 35 On Fri, Dec 4, 2015 at 10:19 PM, Venkatesh Srinivas wrote: > On Mon, Nov 30, 2015 at 11:15:23AM +0200, Michael S. Tsirkin wrote: >> We know vring num is a power of 2, so use & >> to mask the high bits. >> >> Signed-off-by: Michael S. Tsirkin >> --- > > The generated code switches from DIV -> masking, source is clearer as well. First impression was why, now it seems that compiler can't predict this for variables. For constants it would be optimized to the same, I suppose. > > Tested-by: Venkatesh Srinivas > > -- vs; > -- > 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/ -- With Best Regards, Andy Shevchenko -- 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/