Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3632598rwb; Tue, 8 Nov 2022 06:47:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf6TknaG8ryIJ1gbCAluP1BpBNXtcAk1zpjdG8h6dxJFm6KGth0NdyizYgODAeYOTizld+NV X-Received: by 2002:a05:6402:1ac7:b0:466:b14b:497c with SMTP id ba7-20020a0564021ac700b00466b14b497cmr2839751edb.210.1667918863721; Tue, 08 Nov 2022 06:47:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667918863; cv=none; d=google.com; s=arc-20160816; b=BcFwZbhafD6M9RUOod9hJ/Gy2kEsQLmtBZUB+l6g3cDukvgsZvP3BEwHwQBpVYdukG J/y1YKitBMSqUSFLGx11Nkq5Cr1bgcEp2PyKymUuhW/FrLnqbXThVZIgTdQMrB81oKbK Ds+RyeOdaZt7E8QtrYyJRpFy6xR2AsihhGVrdAuCIMtjFnCatVhTj4G8OWIwyFShxr+8 dZte0i7pf/XNT7/sZGb3xwun/BEL/VZTQwTpSRs56A0feyzLFMwbiiaKR55yndDrA5Ok 7a40ctfnTYG4/Fk0zjOSWk22NU+rY4Xa8KExS+xkzsvb8I87Q8twAyMnU6O9SaR6hNLO 6gRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=SfHpfKctBYDonrweIkQotWV0QBPC3lkNcz+qm13i8cQ=; b=FEnY7aoda87K7rN+jHQcF5yO6FaH0u4Ot4+Ay9ZxVI4vVo2M/1KfAZdqxzpVrC/eU+ Uj1oOHO+suL2WEbZ7mDOmNIouDDRL0uwEMrBRv76v2yW7mKe1Po0VmIQYmttRd7gs2xJ rYqPmi/It/htjBHNiWqymQujo4U3zgbWUtBWKDGoif/yPWbLvNH4TLwxuzftTGeE+iYs TlLwJTt5s1ZqeR8am58ZIGquWJ2C1e/6TORyk9XrcDFNd+ymmxA88I6rt2PwClSgW6uV eMqhyg8oQ+I/RQnq9yYzQrrIDasrZ1zPY8wkKGjMf/bA5RukJa+0uXWtYcFVHOP4CWY6 BQxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IeTEoNtt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he41-20020a1709073da900b0078d3a35e181si15006367ejc.871.2022.11.08.06.47.20; Tue, 08 Nov 2022 06:47:43 -0800 (PST) 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=pass header.i=@kernel.org header.s=k20201202 header.b=IeTEoNtt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234343AbiKHNMW (ORCPT + 90 others); Tue, 8 Nov 2022 08:12:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234342AbiKHNMT (ORCPT ); Tue, 8 Nov 2022 08:12:19 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FAE21DDD7 for ; Tue, 8 Nov 2022 05:12:18 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CECE561568 for ; Tue, 8 Nov 2022 13:12:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA4FFC433C1; Tue, 8 Nov 2022 13:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667913137; bh=p3iKK8i/BkE9f32TxyOj+aZvkBrcSPGQ3okA10a8JP8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=IeTEoNtt464NHNuxhiKEfZV77NHJAAtKfCtHe8KqtGJFVFpvEQ7Ob0b2H5VgVLy7n nMnfmwN/eeoguCvB0Zoc3Xjuo5vhaP5xitWrwI64RV36YwdQp/u8I2e9TLH5W+V0Jc mtmf8r8mvCwSnuu+1Aputs0GzWdUn2ajBwuex9TXqP+gGY5kRu6o8V2h2ZdOgh4h4A GaJd95OwRl2YXFsMzd59bHMcRUG99Y06RdWhgjO7ZNh2l7F26VzLNvEUipeCvDHiGI 0nBD5hJWymVXGL5j2/26NkwySZnL+l1m5wWWsC98JQUmTxAWWRYUjcdHSDrO8rANPX Tljq0EPzoMZQQ== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: "liaochang (A)" , Xim Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, rostedt@goodmis.org, mingo@redhat.com, sfr@canb.auug.org.au, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Liao Chang Subject: Re: [PATCH v4 0/8] Add OPTPROBES feature on RISCV In-Reply-To: <598bc40d-e826-f9cc-14fd-f4570051f4c6@huawei.com> References: <20221106100316.2803176-1-chenguokai17@mails.ucas.ac.cn> <87y1sm1z8j.fsf@all.your.base.are.belong.to.us> <9A705974-A007-45E2-BC5D-A7E90821A258@mails.ucas.ac.cn> <598bc40d-e826-f9cc-14fd-f4570051f4c6@huawei.com> Date: Tue, 08 Nov 2022 14:12:14 +0100 Message-ID: <87bkphr3o1.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 "liaochang (A)" writes: >>>> + *rd =3D ((kw | ow) =3D=3D 1UL) ? 0 : __builtin_ctzl((kw | ow) & ~1UL= ); >>>> + *ra =3D (kw =3D=3D 1UL) ? 0 : __builtin_ctzl(kw & ~1UL); >>> >>> Hmm, __builtin_ctzl is undefined for 0, right? Can that be triggered >>> here? > > This corner case has been taken into account, look these condition parts, > if kw =3D=3D 1UL this expression will return 0 directly, no chance to inv= oke __builtin_ctzl. Indeed! Thanks for making that clear! Looking forward to the next revision! Bj=C3=B6rn