mbox series

[0/9] xen/bitops: hweight() cleanup/improvements

Message ID 20240822230635.954557-1-andrew.cooper3@citrix.com (mailing list archive)
Headers show
Series xen/bitops: hweight() cleanup/improvements | expand

Message

Andrew Cooper Aug. 22, 2024, 11:06 p.m. UTC
The next phase of bitops cleanup.  This series:

 1) Untangles the mess around hweight()
 2) Removes some unwise uses of hweight()
 3) Makes it work transparently for RISC-V
 4) Use the POPCNT instruction on x86 when available

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1424000649
https://cirrus-ci.com/build/4947148859506688

Andrew Cooper (9):
  xen/bitops: Reinstate the please tidy message
  xen/bitops: Introduce a multiple_bits_set() helper
  xen/bitops: Convert 'hweight(x) > 1' to new multiple_bits_set()
  xen/bitops: Drop the remnants of hweight{8,16}()
  xen/bitops: Introduce generic_hweightl() and hweightl()
  xen/bitops: Drop hweight_long() and use hweightl()
  xen/bitops: Implement hweight64() in terms of hweightl()
  xen/bitops: Implement hweight32() in terms of hweightl()
  x86/bitops: Use the POPCNT instruction when available

 xen/arch/arm/include/asm/bitops.h |  11 ----
 xen/arch/ppc/include/asm/bitops.h |  11 +---
 xen/arch/x86/cpu/vpmu.c           |   2 +-
 xen/arch/x86/hvm/vlapic.c         |  10 +--
 xen/arch/x86/include/asm/bitops.h |  30 ++++++---
 xen/common/bitmap.c               |   4 +-
 xen/common/bitops.c               |  41 ++++++++++++
 xen/common/numa.c                 |   2 +-
 xen/include/xen/bitops.h          | 102 +++++++++++++-----------------
 xen/include/xen/self-tests.h      |  10 ++-
 xen/lib/Makefile                  |   2 +
 xen/lib/arch-generic-hweightl.S   |  46 ++++++++++++++
 xen/lib/generic-hweightl.c        |  61 ++++++++++++++++++
 13 files changed, 232 insertions(+), 100 deletions(-)
 create mode 100644 xen/lib/arch-generic-hweightl.S
 create mode 100644 xen/lib/generic-hweightl.c