Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFA09C636D3 for ; Sun, 12 Feb 2023 15:08:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229625AbjBLPIm (ORCPT ); Sun, 12 Feb 2023 10:08:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjBLPIk (ORCPT ); Sun, 12 Feb 2023 10:08:40 -0500 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 066721025B; Sun, 12 Feb 2023 07:08:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1676214491; bh=BVZh8NWkfVvv9Bl1sW0aX5grGKzjw9dI0z32Aitq6lM=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=JuFJZ1sDdaD6LaT46e8ggXkg5OTWgFB0HdNirrAh58Al9Hks2Ek2ce5O7JpVZyY9v pR9u52Owr0gk14HbhrSS+jXHntSduKPFXUIC7n4ailVHBqB/H5gqb112bWspIhk+eG xYeNMwrpdFuKJE/uOuyj58QTr3P88EgRLKjkmK58= Received: by b-4.in.mailobj.net [192.168.90.14] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sun, 12 Feb 2023 16:08:11 +0100 (CET) X-EA-Auth: zFIgjDpeiRUBDO/GmC8onFM2fhht9rM/u+kar2gUbBkWuDJIxfDdlEvrEn21W6P30xmuunAprPxUvxW1k7dj7OcCnFanFNKO Date: Sun, 12 Feb 2023 20:38:06 +0530 From: Deepak R Varma To: Bart Van Assche , Julia Lawall Cc: Michael Reed , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Saurabh Singh Sengar , Praveen Kumar , Deepak R Varma Subject: Re: [PATCH] scsi: qla1280: Replace arithmetic addition by bitwise OR Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 11, 2023 at 03:25:03PM -0800, Bart Van Assche wrote: > On 2/7/23 03:54, Deepak R Varma wrote: > > When adding two bit-field mask values, an OR operation offers higher > > performance over an arithmetic operation. So, convert such addition to > > an OR based expression. > > Where is the evidence that supports this claim? On the following page I read > that there is no performance difference when using a modern CPU: https://cs.stackexchange.com/questions/75811/why-is-addition-as-fast-as-bit-wise-operations-in-modern-processors > Hello Bart, You are correct. Modern CPU designs have improved addition and the performance is at par with the bitwise operation. The document I had read earlier mentioned a performance improvement for old CPUs and microprocessors, which today is not the case. Thank you for sharing the link. > > Issue identified using orplus.cocci semantic patch script. > > Where is that script located? Can it be deleted such that submission of > patches similar to this patch stops? I have added Julia to this email to understand how to best use this semantic patch. I already discussed with her on improving the Semantic patch such that it doesn't suggest making change when constants are involved. Thank you, ./drv > > Thanks, > > Bart.