mbox

[v3,0/3] eal: provide leading and trailing zero bit count

Message ID 1673042505-756-1-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
Headers

Message

Tyler Retzlaff Jan. 6, 2023, 10:01 p.m. UTC
  Move existing bit manipulation, log and npow functions from
rte_common.h to rte_bitops.h

Provide leading and trailing zero bit count functions to abstract away
compiler specific implementations.

Include basic unit test for new leading/trailing zero bit count functions.

v3:
  * rename to use 32/64 instead of l/ll suffixes
  * add new functions to rte_bitops.h instead of new header
  * move other bit functions from rte_common.h to rte_bitops.h

v2:
  * use unsigned int instead of unsigned (checkpatches)
  * match multiple include guard naming convention to rte_common.h
  * add explicit extern "C" linkage to rte_bitcount.h
    note: not really needed but checkpatches required
  * add missing space around '-'

Tyler Retzlaff (3):
  eal: move bit functions from common to bitops header
  eal: provide leading and trailing zero bit count abstraction
  test/bitcount: add bitcount tests

 app/test/meson.build            |   2 +
 app/test/test_bitcount.c        |  71 +++++++
 app/test/test_common.c          |   1 +
 lib/eal/common/rte_reciprocal.c |   1 +
 lib/eal/include/rte_bitops.h    | 460 ++++++++++++++++++++++++++++++++++++++++
 lib/eal/include/rte_common.h    | 293 -------------------------
 6 files changed, 535 insertions(+), 293 deletions(-)
 create mode 100644 app/test/test_bitcount.c