BitMagic-C++
Data Structures | Namespaces | Functions
bmutil.h File Reference

Bit manipulation primitives (internal) More...

#include "bmdef.h"
#include "bmconst.h"
Include dependency graph for bmutil.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bm::bit_block_t
 bit-block array wrapped into union for correct interpretation of 32-bit vs 64-bit access vs SIMD More...
 
union  bm::bit_block_t::bunion_t
 
struct  bm::conditional< b >
 ad-hoc conditional expressions More...
 
struct  bm::conditional< false >
 
class  bm::ptr_guard< T >
 Mini auto-pointer for internal memory management. More...
 
struct  bm::and_func
 and functor More...
 
struct  bm::xor_func
 xor functor More...
 
struct  bm::or_func
 or functor More...
 
struct  bm::sub_func
 sub functor More...
 

Namespaces

namespace  bm
 

Functions

template<typename T >
BMFORCEINLINEbm::min_value (T v1, T v2) BMNOEXCEPT
 Get minimum of 2 values. More...
 
template<typename T >
BMFORCEINLINEbm::ilog2 (T x) BMNOEXCEPT
 Fast loop-less function to find LOG2. More...
 
template<>
BMFORCEINLINE bm::gap_word_t bm::ilog2 (gap_word_t x) BMNOEXCEPT
 
BMFORCEINLINE unsigned bm::count_leading_zeros (unsigned x) BMNOEXCEPT
 Portable LZCNT with (uses minimal LUT) More...
 
BMFORCEINLINE unsigned bm::count_trailing_zeros (unsigned v) BMNOEXCEPT
 Portable TZCNT with (uses 37-LUT) More...
 
template<typename T >
BMFORCEINLINEbm::ilog2_LUT (T x) BMNOEXCEPT
 Lookup table based integer LOG2. More...
 
template<>
BMFORCEINLINE bm::gap_word_t bm::ilog2_LUT< bm::gap_word_t > (bm::gap_word_t x) BMNOEXCEPT
 Lookup table based short integer LOG2. More...
 
template<typename T >
BMFORCEINLINEbm::bit_scan_fwd (T v) BMNOEXCEPT
  More...
 
BMFORCEINLINE unsigned bm::bit_scan_reverse32 (unsigned w) BMNOEXCEPT
  More...
 
BMFORCEINLINE unsigned bm::bit_scan_forward32 (unsigned w) BMNOEXCEPT
  More...
 
BMFORCEINLINE unsigned long long bm::bmi_bslr_u64 (unsigned long long w) BMNOEXCEPT
  More...
 
BMFORCEINLINE unsigned long long bm::bmi_blsi_u64 (unsigned long long w)
  More...
 
unsigned bm::count_leading_zeros_u32 (unsigned w) BMNOEXCEPT
 32-bit bit-scan reverse More...
 
unsigned bm::count_leading_zeros_u64 (bm::id64_t w) BMNOEXCEPT
 64-bit bit-scan reverse More...
 
unsigned bm::count_trailing_zeros_u32 (unsigned w) BMNOEXCEPT
 32-bit bit-scan fwd More...
 
unsigned bm::count_trailing_zeros_u64 (bm::id64_t w) BMNOEXCEPT
 64-bit bit-scan fwd More...
 
template<class T >
unsigned bm::bit_scan_reverse (T value) BMNOEXCEPT
  More...
 
BMFORCEINLINE unsigned bm::mask_r_u32 (unsigned nbit) BMNOEXCEPT
  More...
 
BMFORCEINLINE unsigned bm::mask_l_u32 (unsigned nbit) BMNOEXCEPT
  More...
 
template<typename W >
BMFORCEINLINE void bm::xor_swap (W &x, W &y) BMNOEXCEPT
 XOR swap two variables. More...
 
unsigned bm::compute_h64_mask (unsigned long long w)
 Сompute mask of bytes presense in 64-bit word. More...
 
BMFORCEINLINE bm::id_t bm::word_bitcount (bm::id_t w) BMNOEXCEPT
  More...
 
BMFORCEINLINE unsigned bm::word_bitcount64 (bm::id64_t x) BMNOEXCEPT
  More...
 
template<typename T >
bool bm::is_aligned (T *p)
 Check pointer alignment. More...
 

Detailed Description

Bit manipulation primitives (internal)

Definition in file bmutil.h.