From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBB2A7E for ; Wed, 7 Sep 2022 04:06:55 +0000 (UTC) Received: from nazgul.tnic (unknown [84.201.196.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 6786E1EC068F; Wed, 7 Sep 2022 06:06:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1662523609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=oF8uyun+ouCeH4rU0Sgny6nXLM0tjw0TQ71zarK9tig=; b=I66wrZ08yscrWobgTr7tjuBmYVub0sMgs1pmnJ2jRbXAi7RAAscCJHcTwJKc5ZcMnGu1VR 8+rc3rFQ9+g2ra5WsruBdluAyQ/YcsIGwA9+G89xQZiLoWl3bEZ8vR6O4QFMht8Z1yScjM clZ7EIynTYl84Kq+6QPYN9ZbsnKgW+A= Date: Wed, 7 Sep 2022 06:06:58 +0200 From: Borislav Petkov To: Vincent MAILHOL Cc: Nick Desaulniers , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Peter Zijlstra , Dave Hansen , "H . Peter Anvin" , Nathan Chancellor , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, David Howells , Jan Beulich , Christophe Jaillet , Joe Perches , Josh Poimboeuf Subject: Re: [PATCH v5 2/2] x86/asm/bitops: __ffs,ffz: use __builtin_ctzl to evaluate constant expressions Message-ID: References: <20220812114438.1574-1-mailhol.vincent@wanadoo.fr> <20220812114438.1574-3-mailhol.vincent@wanadoo.fr> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Sat, Aug 27, 2022 at 06:32:05AM +0900, Vincent MAILHOL wrote: > Agree that this is only the surface. But, my patch series is about > constant folding, not about the text of *ffs(). Here, I just *move* > the existing text, I did not modify anything. > Can we agree that this is a separate topic? Sure we can. But then you can't start your commit message with: "__ffs(x) is equivalent to (unsigned long)__builtin_ctzl(x) and ffz(x) is equivalent to (unsigned long)__builtin_ctzl(~x)." which will bring unenlightened readers like me into the very same mess. So at least mention that there's a difference between the kernel implementation using hw insns which are well defined on some machines and what the glibc API does. So that at least people are aware that there's something dangerous to be cautious about. Ok? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette