[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251124170257.GHaSSPwe1nDUQgI5MQ@fat_crate.local>
Date: Mon, 24 Nov 2025 18:02:57 +0100
From: Borislav Petkov <bp@...en8.de>
To: Nikolay Borisov <nik.borisov@...e.com>
Cc: linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
Yazen.Ghannam@....com
Subject: Re: [PATCH] RAS/AMD/ATL: Replace bitwise_xor_bits() with hweight16()
On Mon, Nov 24, 2025 at 04:25:17PM +0200, Nikolay Borisov wrote:
> Doing hweight16 and checking whether the lsb is set is functionally
> equivalent to what bitwise_xor_bits() does. In addition it results in
> better generated code as before gcc would inline the function 4 times.
> With hweight, the resulting code boils down to 2 instructions - popcnt
> and andl as all cpus we care about has popcnt. No functional changes.
>
> An alternative would have been to use the __builtin_parity() function provided
> by both Clang/GCC, however under some circumstances the compiler can choose not
> to inline it but generate a library call which is unsupported in the kernel.
>
> Signed-off-by: Nikolay Borisov <nik.borisov@...e.com>
> ---
> drivers/ras/amd/atl/umc.c | 21 +++++----------------
> 1 file changed, 5 insertions(+), 16 deletions(-)
Applied, thanks.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists