Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2681322rwi; Fri, 28 Oct 2022 09:53:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4YWRjDmECWecmhEY6K5akkzMHHgtuwOSHYF7xzASWKCo4snGAqlsN2cx82EG5PQCDAd32E X-Received: by 2002:a17:902:ebce:b0:186:dcc3:5135 with SMTP id p14-20020a170902ebce00b00186dcc35135mr89033plg.138.1666976024955; Fri, 28 Oct 2022 09:53:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666976024; cv=none; d=google.com; s=arc-20160816; b=dpI08AMswpMJ0E/jY7VrZpSDEgsqa+FkCYxGBJ7SPg/qKXRdAGg5ifuo1OzuFG4/xJ JfIwqFIbBXjxtZJDv6w+qcSnhkriL7uaorOneDRnMMChpzbFpTA5qF0us7CEOZ8VRhPS cHTQ175G8kuQMepj+8Mk+p/z9HljmgvKsHWEBgqQNJpRkJmZDw6jBttCdR7KjHWQwOYm JPLaBYnZjzvrNeiR+c5AwAVftSumeCW37Zgk8WR8BJ/309Ki0uicGD1HCXzhD9J/v4NI INVFeFlsv9gr47W2a/NlzShvNgacpRYKe2GvaKZTkuitok73CpHlowLY8ILMGAd/6/Sm gGpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:sender:message-id:content-transfer-encoding :content-disposition:mime-version:subject:cc:to:from:references :in-reply-to:dkim-signature; bh=QKytlREYiTLpgxfFh35rP21mKKtH4zCnPdMR02CiPB4=; b=YPQfZ18nf1/OoF4YTJndOS/p5iXMVacasYzK9pYBr3NYzIYnHEzQbgxHjLdM4h2TQx 2MVgpurYPuOx+06KtgpCkz5Fma48vCpBamNvo+Y04KSph+tuViCmmi2iIJwA6amlGtcG sAhB8ZlfzfDv3+Ua2rCdjucgFelJMcZciidKacEVbbJHlELTQdKX7vRBw/gpdhNCTmdq hONEuEO0KiaGEi89e+9M+tW02W7kISYljBPAYVAs3MJN3VaDZthtXoJwtLz9fYNT9rV7 HWdUt034fBOkALT4nbuCgMV3SaknmtuDQVjn9r1W/4w5C8szJQL0uBpQFxqkjZwXKjvP GMSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=tUYLUTBO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rm4-20020a17090b3ec400b0020319d3bb7bsi7105313pjb.18.2022.10.28.09.53.33; Fri, 28 Oct 2022 09:53:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=tUYLUTBO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229973AbiJ1QsA (ORCPT + 99 others); Fri, 28 Oct 2022 12:48:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbiJ1Qr6 (ORCPT ); Fri, 28 Oct 2022 12:47:58 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD5461EEA3F for ; Fri, 28 Oct 2022 09:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QKytlREYiTLpgxfFh35rP21mKKtH4zCnPdMR02CiPB4=; b=tUYLUTBO4ITtmpwmX0vst1lWZZ DVnidmNbD/Q7dg/D0oMx6J93/GV4M4yHYoR8tkpq7920ihF9F+AkLTW5rjFNS9hWIJIt0zPwRzfWJ ufzAIXuYC6yl7KKuRcbvKLwSIW3F9p/cYgZl47J4oYVDBp5pFnr61O+9o6Ap7kxIVrjhHH2TF+rVa t0PTvqd37R1IF3iH4iWuFiptMNoT7phGxK81N6M1dmUp5Hujz+k8q+9lxX5lfLBBfDLHtVuGDmAML gm2Guc6v0yrxAtCMba0DDGai43H5vWv6isL/87B3MwJfJBr4zwuxDPh+czo2GVRqa6DDwxmWyT+Z/ LAX4cMqg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55688 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ooSWP-00006W-OE; Fri, 28 Oct 2022 17:47:53 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1ooSWP-000FDy-5t; Fri, 28 Oct 2022 17:47:53 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Yury Norov Cc: Catalin Marinas , Mark Rutland , Will Deacon , Linux Kernel Mailing List , Linus Torvalds , linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/5] ARM: findbit: document ARMv5 bit offset calculation MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Fri, 28 Oct 2022 17:47:53 +0100 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Document the ARMv5 bit offset calculation code. Signed-off-by: Russell King (Oracle) --- arch/arm/lib/findbit.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/lib/findbit.S b/arch/arm/lib/findbit.S index 7fd3600db8ef..4c584bc4704b 100644 --- a/arch/arm/lib/findbit.S +++ b/arch/arm/lib/findbit.S @@ -172,10 +172,10 @@ ENDPROC(_find_next_bit_be) .L_found: #if __LINUX_ARM_ARCH__ >= 5 rsb r0, r3, #0 - and r3, r3, r0 - clz r3, r3 - rsb r3, r3, #31 - add r0, r2, r3 + and r3, r3, r0 @ mask out lowest bit set + clz r3, r3 @ count high zero bits + rsb r3, r3, #31 @ offset of first set bit + add r0, r2, r3 @ add offset of first set bit #else tst r3, #0x0f addeq r2, r2, #4 -- 2.30.2