On 29.08.2024 00:03, Andrew Cooper wrote:
> There are 6 remaining callers in Xen:
> 
>   * The two hweight32() calls, _domain_struct_bits() and efi_find_gop_mode(),
>     are __init only.
>   * The two hweight_long() calls are both in bitmap_weight().
>   * The two hweight64() calls are hv_vpset_nr_banks() and x86_emulate().
> 
> Only bitmap_weight() and possibly hv_vpset_nr_banks() can be considered fast
> paths, and they're all of GPR-width form.
> 
> Furthermore, the differences between a generic int and generic long form is
> only an ADD and SHIFT, and only in !CONFIG_HAS_FAST_MULTIPLY builds.
> 
> Therefore, it is definitely not worth having both generic implemenations.
> 
> Implement generic_hweightl() based on the current generic_hweight64(),
> adjusted to be compatible with ARM32, along with standard SELF_TESTS.
> 
> Implement hweightl() with usual constant-folding and arch opt-in support.  PPC
> is the only architecture that devates from generic, and it simply uses the
> builtin.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>

Reviewed-by: Jan Beulich <jbeul...@suse.com>



Reply via email to