Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
universal_bitset::BaseBitset< 0 > Struct Reference

Base class, specialization for no storage (zero-length bitset). More...

#include <ubb.h>

Public Member Functions

constexpr BaseBitset () noexcept
constexpr BaseBitset (unsigned long long) noexcept
WordT & M_getword (size_t) noexcept
constexpr WordT M_getword (size_t) const noexcept
constexpr WordT M_hiword () const noexcept
void M_do_and (const BaseBitset< 0 > &) noexcept
void M_do_or (const BaseBitset< 0 > &) noexcept
void M_do_xor (const BaseBitset< 0 > &) noexcept
void M_do_left_shift (size_t) noexcept
void M_do_right_shift (size_t) noexcept
void M_do_flip () noexcept
void M_do_set () noexcept
void M_do_reset () noexcept
bool M_is_equal (const BaseBitset< 0 > &) const noexcept
bool M_is_less_than (const BaseBitset< 0 > &) const noexcept
bool M_is_greater_than (const BaseBitset< 0 > &) const noexcept
int M_getMSB () const noexcept
bool M_increment () const noexcept
bool M_decrement () const noexcept
template<size_t Nb>
bool M_are_all () const noexcept
bool M_is_any () const noexcept
size_t M_do_count () const noexcept
unsigned long M_do_to_ulong () const noexcept
unsigned long long M_do_to_ullong () const noexcept
size_t M_do_find_first (size_t) const noexcept
size_t M_do_find_next (size_t, size_t) const noexcept
constexpr bool M_testBit (size_t pos) const noexcept
const WordT * M_getdata () const noexcept
bool M_do_add (const BaseBitset< UBB_WORDS(Nb)> &a, const BaseBitset< UBB_WORDS(Nb)> &b) noexcept
 Slotwise addtion to this value.
bool M_do_sub (const BaseBitset< UBB_WORDS(Nb)> &a, const BaseBitset< UBB_WORDS(Nb)> &b) noexcept
 Slotwise subtraction into this value.

Static Public Member Functions

static constexpr size_t S_whichword (size_t pos) noexcept
static constexpr size_t S_whichbyte (size_t pos) noexcept
static constexpr size_t S_whichbit (size_t pos) noexcept
static constexpr WordT S_maskbit (size_t pos) noexcept
static int S_getMSB (const WordT &val)
 Finds leading bit of value passed.
static bool S_increment (WordT &val)
 increments the value passed.
static bool S_decrement (WordT &val)
 decrements the value passed.
static bool S_add (WordT &accum, const WordT &a, const WordT &b, bool carry)
 Performs a two-operand addition on a single slot.
static bool S_sub (WordT &accum, const WordT &a, const WordT &b, const bool borrow)
 Performs a two-operand subtraction on a single slot.

Public Attributes

WordT M_w [Nw]
 0 is the least significant word.

Detailed Description

Base class, specialization for no storage (zero-length bitset).

See documentation for bitset.

Constructor & Destructor Documentation

◆ BaseBitset() [1/2]

universal_bitset::BaseBitset< 0 >::BaseBitset ( )
inlineconstexprnoexcept

◆ BaseBitset() [2/2]

universal_bitset::BaseBitset< 0 >::BaseBitset ( unsigned long long )
inlineconstexprnoexcept

Member Function Documentation

◆ M_are_all()

template<size_t Nb>
bool universal_bitset::BaseBitset< 0 >::M_are_all ( ) const
inlinenoexcept

◆ M_decrement()

bool universal_bitset::BaseBitset< 0 >::M_decrement ( ) const
inlinenoexcept

◆ M_do_add()

bool universal_bitset::BaseBitset< Nw >::M_do_add ( const BaseBitset< UBB_WORDS(Nb)> & a,
const BaseBitset< UBB_WORDS(Nb)> & b )
inlinenoexcept

Slotwise addtion to this value.

Parameters
ais an addend.
bis an addend.
Returns
true iff carry generated.

◆ M_do_and()

void universal_bitset::BaseBitset< 0 >::M_do_and ( const BaseBitset< 0 > & )
inlinenoexcept

◆ M_do_count()

size_t universal_bitset::BaseBitset< 0 >::M_do_count ( ) const
inlinenoexcept

◆ M_do_find_first()

size_t universal_bitset::BaseBitset< 0 >::M_do_find_first ( size_t ) const
inlinenoexcept

◆ M_do_find_next()

size_t universal_bitset::BaseBitset< 0 >::M_do_find_next ( size_t ,
size_t  ) const
inlinenoexcept

◆ M_do_flip()

void universal_bitset::BaseBitset< 0 >::M_do_flip ( )
inlinenoexcept

◆ M_do_left_shift()

void universal_bitset::BaseBitset< 0 >::M_do_left_shift ( size_t )
inlinenoexcept

◆ M_do_or()

void universal_bitset::BaseBitset< 0 >::M_do_or ( const BaseBitset< 0 > & )
inlinenoexcept

◆ M_do_reset()

void universal_bitset::BaseBitset< 0 >::M_do_reset ( )
inlinenoexcept

◆ M_do_right_shift()

void universal_bitset::BaseBitset< 0 >::M_do_right_shift ( size_t )
inlinenoexcept

◆ M_do_set()

void universal_bitset::BaseBitset< 0 >::M_do_set ( )
inlinenoexcept

◆ M_do_sub()

bool universal_bitset::BaseBitset< Nw >::M_do_sub ( const BaseBitset< UBB_WORDS(Nb)> & a,
const BaseBitset< UBB_WORDS(Nb)> & b )
inlinenoexcept

Slotwise subtraction into this value.

Parameters
ais the minuend.
bis the subtrahend.

◆ M_do_to_ullong()

unsigned long long universal_bitset::BaseBitset< 0 >::M_do_to_ullong ( ) const
inlinenoexcept

◆ M_do_to_ulong()

unsigned long universal_bitset::BaseBitset< 0 >::M_do_to_ulong ( ) const
inlinenoexcept

◆ M_do_xor()

void universal_bitset::BaseBitset< 0 >::M_do_xor ( const BaseBitset< 0 > & )
inlinenoexcept

◆ M_getdata()

const WordT * universal_bitset::BaseBitset< Nw >::M_getdata ( ) const
inlinenoexcept

◆ M_getMSB()

int universal_bitset::BaseBitset< 0 >::M_getMSB ( ) const
inlinenoexcept

◆ M_getword() [1/2]

WordT universal_bitset::BaseBitset< 0 >::M_getword ( size_t ) const
inlineconstexprnoexcept

◆ M_getword() [2/2]

WordT & universal_bitset::BaseBitset< 0 >::M_getword ( size_t )
inlinenoexcept

◆ M_hiword()

WordT universal_bitset::BaseBitset< 0 >::M_hiword ( ) const
inlineconstexprnoexcept

◆ M_increment()

bool universal_bitset::BaseBitset< 0 >::M_increment ( ) const
inlinenoexcept

◆ M_is_any()

bool universal_bitset::BaseBitset< 0 >::M_is_any ( ) const
inlinenoexcept

◆ M_is_equal()

bool universal_bitset::BaseBitset< 0 >::M_is_equal ( const BaseBitset< 0 > & ) const
inlinenoexcept

◆ M_is_greater_than()

bool universal_bitset::BaseBitset< 0 >::M_is_greater_than ( const BaseBitset< 0 > & ) const
inlinenoexcept

◆ M_is_less_than()

bool universal_bitset::BaseBitset< 0 >::M_is_less_than ( const BaseBitset< 0 > & ) const
inlinenoexcept

◆ M_testBit()

bool universal_bitset::BaseBitset< Nw >::M_testBit ( size_t pos) const
inlineconstexprnoexcept

◆ S_add()

bool universal_bitset::BaseBitset< Nw >::S_add ( WordT & accum,
const WordT & a,
const WordT & b,
bool carry )
inlinestatic

Performs a two-operand addition on a single slot.

Parameters
[in,out]accumaccumulates the sum.
ais an addend.
bis an addend.
carryis true iff a carry was generated by the previous slot.
Returns
true iff a full slot carry precipitated.

◆ S_decrement()

bool universal_bitset::BaseBitset< Nw >::S_decrement ( WordT & val)
inlinestatic

decrements the value passed.

Parameters
[in,out]valthe value to be decremented.
Returns
true iff (unsigned) decrement precipitates a borrow.

◆ S_getMSB()

int universal_bitset::BaseBitset< Nw >::S_getMSB ( const WordT & val)
inlinestatic

Finds leading bit of value passed.

Parameters
valis said value.
Returns
leading bit position, if any, else -1.

◆ S_increment()

bool universal_bitset::BaseBitset< Nw >::S_increment ( WordT & val)
inlinestatic

increments the value passed.

Parameters
[in,out]valthe value to be incremented.
Returns
true iff (unsigned) increment precipitates a carry.

◆ S_maskbit()

constexpr WordT universal_bitset::BaseBitset< 0 >::S_maskbit ( size_t pos)
inlinestaticconstexprnoexcept

◆ S_sub()

bool universal_bitset::BaseBitset< Nw >::S_sub ( WordT & accum,
const WordT & a,
const WordT & b,
const bool borrow )
inlinestatic

Performs a two-operand subtraction on a single slot.

Parameters
[in,out]accumaccumulates the sum.
ais the minuend.
bis the (pre-borrow) subtrahend.
borrowinidcates whether a borrow applies from the previous slot.
Returns
true iff a full slot borrow precipitated.

◆ S_whichbit()

constexpr size_t universal_bitset::BaseBitset< 0 >::S_whichbit ( size_t pos)
inlinestaticconstexprnoexcept

◆ S_whichbyte()

constexpr size_t universal_bitset::BaseBitset< 0 >::S_whichbyte ( size_t pos)
inlinestaticconstexprnoexcept

◆ S_whichword()

constexpr size_t universal_bitset::BaseBitset< 0 >::S_whichword ( size_t pos)
inlinestaticconstexprnoexcept

Member Data Documentation

◆ M_w

0 is the least significant word.


The documentation for this struct was generated from the following file:
  • /home/runner/work/universal/universal/include/sw/universal/internal/bitblock/ubb.h