Eisenwave / cxx26-bit-permutations

Reference implementation of C++26 bit permutation functions, as proposed.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++26 Bit Permutations

This project is a reference implementation for Pxxxx: Bit Permutations (new proposal, not yet published).

This project provides a single-header reference implementation of the functions

  • bit_reverse
  • bit_repeat
  • next_bit_permutation
  • prev_bit_permutation
  • bit_compressr
  • bit_expandr
  • bit_compressl
  • bit_expandl

There are also implementations of existing <bit> functions for the purpose of testing. The standard library functions don't support _BitInt or 128-bit integers, so it was necessary to circumvent them:

  • popcount
  • countl_zero
  • countl_one
  • countr_zero
  • countr_one

All functions are located in namespace cxx26bp.

This implementation aims to provide the fastest possible library implementation for each of these functions, using any possible hardware support. This project is portable, and tries to support

  • Architectures: x86, ARM
  • Compilers: MSVC, GCC, Clang

About

Reference implementation of C++26 bit permutation functions, as proposed.


Languages

Language:C++ 98.6%Language:CMake 1.4%