|
Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
|
Base class, general case. More...
#include <ubb.h>
Public Member Functions | |
| constexpr | BaseBitset () noexcept |
| constexpr | BaseBitset (unsigned long long val) noexcept |
| constexpr bool | M_testBit (size_t pos) const noexcept |
| WordT & | M_getword (size_t pos) noexcept |
| constexpr WordT | M_getword (size_t pos) const noexcept |
| const WordT * | M_getdata () const noexcept |
| WordT & | M_hiword () noexcept |
| constexpr WordT | M_hiword () const noexcept |
| void | M_do_and (const BaseBitset< Nw > &x) noexcept |
| void | M_do_or (const BaseBitset< Nw > &x) noexcept |
| void | M_do_xor (const BaseBitset< Nw > &x) noexcept |
| void | M_do_left_shift (size_t shift) noexcept |
| void | M_do_right_shift (size_t shift) noexcept |
| void | M_do_flip () noexcept |
| void | M_do_set () noexcept |
| void | M_do_reset () noexcept |
| bool | M_is_equal (const BaseBitset< Nw > &x) const noexcept |
| bool | M_is_less_than (const BaseBitset< Nw > &x) const noexcept |
| Blocked unsigned less-than operation. | |
| bool | M_is_greater_than (const BaseBitset< Nw > &x) const noexcept |
| Blocked unsigned greater-than operation. | |
| int | M_getMSB () const noexcept |
| Finds the position of the highest set bit. | |
| bool | M_increment () noexcept |
| Increments underlying value by unity. | |
| bool | M_decrement () noexcept |
| Decrements underlying value by unity. | |
| template<size_t Nb> | |
| bool | M_do_add (const BaseBitset< UBB_WORDS(Nb)> &a, const BaseBitset< UBB_WORDS(Nb)> &b) noexcept |
| Slotwise addtion to this value. | |
| template<size_t Nb> | |
| bool | M_do_add (const BaseBitset< UBB_WORDS(Nb)> &a) noexcept |
| Slotwise increment of this value. | |
| template<size_t Nb> | |
| bool | M_do_sub (const BaseBitset< UBB_WORDS(Nb)> &a, const BaseBitset< UBB_WORDS(Nb)> &b) noexcept |
| Slotwise subtraction into this value. | |
| template<size_t Nb> | |
| bool | M_do_sub (const BaseBitset< UBB_WORDS(Nb)> &a) noexcept |
| Slotwise decrement of this value. | |
| 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 |
| unsigned long long | M_do_to_ullong () const |
| size_t | M_do_find_first (size_t) const noexcept |
| size_t | M_do_find_next (size_t, size_t) const noexcept |
Static Public Member Functions | |
| 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_add (WordT &accum, const WordT &a, 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. | |
| static bool | S_sub (WordT &accum, const WordT &a, bool borrow) |
| Performs a single-operand subtraction. | |
| 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 |
Public Attributes | |
| WordT | M_w [Nw] |
| 0 is the least significant word. | |
Base class, general case.
It is a class invariant that Nw will be nonnegative.
See documentation for bitset.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Decrements underlying value by unity.
|
inlinenoexcept |
Slotwise increment of this value.
| a | is an addend. |
|
inlinenoexcept |
Slotwise addtion to this value.
| a | is an addend. |
| b | is an addend. |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
|
inlinenoexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Slotwise decrement of this value.
| a | is the subtrahend. |
|
inlinenoexcept |
Slotwise subtraction into this value.
| a | is the minuend. |
| b | is the subtrahend. |
| unsigned long long universal_bitset::BaseBitset< Nw >::M_do_to_ullong | ( | ) | const |
| unsigned long universal_bitset::BaseBitset< Nw >::M_do_to_ulong | ( | ) | const |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Finds the position of the highest set bit.
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Increments underlying value by unity.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Blocked unsigned greater-than operation.
| x | is the comparison value. |
|
inlinenoexcept |
Blocked unsigned less-than operation.
| x | is the comparison value. |
|
inlineconstexprnoexcept |
|
inlinestatic |
Performs a two-operand addition on a single slot.
| [in,out] | accum | accumulates the sum. |
| a | is an addend. | |
| carry | is true iff a carry was generated by the previous slot. |
|
inlinestatic |
Performs a two-operand addition on a single slot.
| [in,out] | accum | accumulates the sum. |
| a | is an addend. | |
| b | is an addend. | |
| carry | is true iff a carry was generated by the previous slot. |
|
inlinestatic |
decrements the value passed.
| [in,out] | val | the value to be decremented. |
|
inlinestatic |
Finds leading bit of value passed.
| val | is said value. |
|
inlinestatic |
increments the value passed.
| [in,out] | val | the value to be incremented. |
|
inlinestaticconstexprnoexcept |
|
inlinestatic |
Performs a single-operand subtraction.
| [in,out] | accum | accumulates the sum. |
| a | is the (pre-borrow) subtrahend. | |
| borrow | inidcates whether a borrow applies from the previous slot. |
|
inlinestatic |
Performs a two-operand subtraction on a single slot.
| [in,out] | accum | accumulates the sum. |
| a | is the minuend. | |
| b | is the (pre-borrow) subtrahend. | |
| borrow | inidcates whether a borrow applies from the previous slot. |
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
| WordT universal_bitset::BaseBitset< Nw >::M_w[Nw] |
0 is the least significant word.