BitMagic-C++
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.
template<typename T>
BMFORCEINLINEbm::ilog2 (T x) BMNOEXCEPT
 Fast loop-less function to find LOG2.
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).
BMFORCEINLINE unsigned bm::count_trailing_zeros (unsigned v) BMNOEXCEPT
 Portable TZCNT with (uses 37-LUT).
template<typename T>
BMFORCEINLINEbm::ilog2_LUT (T x) BMNOEXCEPT
 Lookup table based integer LOG2.
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.
template<typename T>
BMFORCEINLINEbm::bit_scan_fwd (T v) BMNOEXCEPT
BMFORCEINLINE unsigned bm::bit_scan_reverse32 (unsigned w) BMNOEXCEPT
BMFORCEINLINE unsigned bm::bit_scan_forward32 (unsigned w) BMNOEXCEPT
BMFORCEINLINE unsigned long long bm::bmi_bslr_u64 (unsigned long long w) BMNOEXCEPT
BMFORCEINLINE unsigned long long bm::bmi_blsi_u64 (unsigned long long w)
unsigned bm::count_leading_zeros_u32 (unsigned w) BMNOEXCEPT
 32-bit bit-scan reverse
unsigned bm::count_leading_zeros_u64 (bm::id64_t w) BMNOEXCEPT
 64-bit bit-scan reverse
unsigned bm::count_trailing_zeros_u32 (unsigned w) BMNOEXCEPT
 32-bit bit-scan fwd
unsigned bm::count_trailing_zeros_u64 (bm::id64_t w) BMNOEXCEPT
 64-bit bit-scan fwd
template<class T>
unsigned bm::bit_scan_reverse (T value) BMNOEXCEPT
BMFORCEINLINE unsigned bm::mask_r_u32 (unsigned nbit) BMNOEXCEPT
BMFORCEINLINE unsigned bm::mask_l_u32 (unsigned nbit) BMNOEXCEPT
template<typename W>
BMFORCEINLINE void bm::xor_swap (W &x, W &y) BMNOEXCEPT
 XOR swap two variables.
unsigned bm::compute_h64_mask (unsigned long long w) BMNOEXCEPT
 Сompute mask of bytes presense in 64-bit word.
BMFORCEINLINE bool bm::has_zero_byte_u64 (bm::id64_t v) BMNOEXCEPT
 Returns true if INT64 contains 0 octet.
BMFORCEINLINE bm::id_t bm::word_bitcount (bm::id_t w) BMNOEXCEPT
BMFORCEINLINE unsigned bm::word_bitcount64 (bm::id64_t x) BMNOEXCEPT
template<typename T>
bool bm::is_aligned (T *p) BMNOEXCEPT
 Check pointer alignment.

Detailed Description

Bit manipulation primitives (internal).

Definition in file bmutil.h.