[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250325171141.GDZ-LjzaPbAG1MwjZi@fat_crate.local>
Date: Tue, 25 Mar 2025 18:11:41 +0100
From: Borislav Petkov <bp@...en8.de>
To: Uros Bizjak <ubizjak@...il.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH -tip 2/2] x86/hweight: Use POPCNT when available with
X86_NATIVE_CPU option
On Tue, Mar 25, 2025 at 05:48:38PM +0100, Uros Bizjak wrote:
> +#ifdef __POPCNT__
> + asm_inline (ASM_FORCE_CLR "popcntl %[val], %[cnt]"
> + : [cnt] "=&r" (res)
> + : [val] ASM_INPUT_RM (w));
> +#else
> asm_inline (ALTERNATIVE(ANNOTATE_IGNORE_ALTERNATIVE
> "call __sw_hweight32",
> ASM_CLR "popcntl %[val], %[cnt]",
> X86_FEATURE_POPCNT)
> : [cnt] "=a" (res), ASM_CALL_CONSTRAINT
> : [val] REG_IN (w));
> -
> +#endif
A whopping 599 bytes which makes the asm more ugly.
Not worth the effort IMO.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists