Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
sw::universal::blockbinary< _nbits, bt, _NumberType > Class Template Reference

#include <blockbinary.hpp>

Public Types

typedef bt BlockType

Public Member Functions

 blockbinary ()=default
 trivial constructor
template<unsigned nnbits>
constexpr blockbinary (const blockbinary< nnbits, BlockType, NumberType > &rhs)
 construct a blockbinary from another: bt must be the same
constexpr blockbinary (long long initial_value) noexcept
constexpr blockbinary (const std::string &s) noexcept
constexpr blockbinary (const SpecificValue code)
constexpr blockbinary & operator= (long long rhs) noexcept
constexpr operator int () const
constexpr operator long () const
constexpr operator long long () const
constexpr operator unsigned int () const
constexpr operator unsigned long () const
constexpr operator unsigned long long () const
 operator float () const
 operator double () const
constexpr BlockType operator[] (unsigned index) const
constexpr blockbinary operator- () const
constexpr blockbinary operator~ () const
constexpr blockbinary operator++ (int)
constexpr blockbinary & operator++ ()
constexpr blockbinary operator-- (int)
constexpr blockbinary & operator-- ()
constexpr blockbinary & operator+= (const blockbinary &rhs)
constexpr blockbinary & operator-= (const blockbinary &rhs)
constexpr blockbinary & operator*= (const blockbinary &rhs)
constexpr blockbinary & operator/= (const blockbinary &rhs)
constexpr blockbinary & operator%= (const blockbinary &rhs)
constexpr blockbinary & operator|= (const blockbinary &rhs) noexcept
 logic operators
constexpr blockbinary & operator&= (const blockbinary &rhs) noexcept
constexpr blockbinary & operator^= (const blockbinary &rhs) noexcept
constexpr blockbinary & operator<<= (int bitsToShift)
constexpr blockbinary & operator>>= (int bitsToShift)
constexpr void clear () noexcept
 modifiers
constexpr void setzero () noexcept
constexpr blockbinary & divide_by_zero ()
constexpr void set () noexcept
constexpr void reset () noexcept
constexpr void set (unsigned i) noexcept
constexpr void reset (unsigned i) noexcept
constexpr void setbit (unsigned i, bool v=true) noexcept
constexpr void setbits (uint64_t value) noexcept
constexpr void setblock (unsigned b, const bt &blockBits) noexcept
constexpr blockbinary & flip () noexcept
constexpr blockbinary & twosComplement () noexcept
 in-place 2's complement
constexpr blockbinary & minpos () noexcept
constexpr blockbinary & maxpos () noexcept
constexpr blockbinary & zero () noexcept
constexpr blockbinary & minneg () noexcept
constexpr blockbinary & maxneg () noexcept
constexpr bool sign () const noexcept
constexpr bool ispos () const noexcept
constexpr bool isneg () const noexcept
constexpr bool iszero () const noexcept
constexpr bool isodd () const noexcept
constexpr bool iseven () const noexcept
constexpr bool all () const noexcept
constexpr bool any () const noexcept
constexpr bool anyAfter (unsigned bitIndex) const noexcept
constexpr bool none () const noexcept
constexpr unsigned count () const noexcept
constexpr bool test (unsigned bitIndex) const noexcept
constexpr bool at (unsigned bitIndex) const noexcept
constexpr uint8_t nibble (unsigned n) const noexcept
constexpr bt block (unsigned b) const noexcept
template<unsigned srcbits>
constexpr blockbinary< nbits, bt, NumberType > & assign (const blockbinary< srcbits, bt, NumberType > &rhs)
template<unsigned srcbits>
constexpr blockbinary< nbits, bt, NumberType > & assignWithoutSignExtend (const blockbinary< srcbits, bt, NumberType > &rhs)
constexpr int msb () const noexcept
constexpr int64_t to_sll () const
constexpr uint64_t to_ull () const
template<typename Real, typename = typename std::enable_if< std::is_floating_point<Real>::value, Real >::type>
Real to_native () const
constexpr bool roundingMode (unsigned targetLsb) const
constexpr bool any (unsigned msb) const

Static Public Attributes

static constexpr unsigned nbits = _nbits
static constexpr BinaryNumberType NumberType = _NumberType
static constexpr unsigned bitsInByte = 8
static constexpr unsigned bitsInBlock = sizeof(bt) * bitsInByte
static constexpr unsigned nrBlocks = (0 == nbits ? 1 : (1ull + ((nbits - 1ull) / bitsInBlock)))
static constexpr uint64_t storageMask = (0xFFFFFFFFFFFFFFFFull >> (64 - bitsInBlock))
static constexpr bt maxBlockValue = bt(-1)
static constexpr unsigned MSU = nrBlocks - 1
static constexpr bt ALL_ONES = bt(~0)
static constexpr unsigned maxShift = (0 == nbits ? 0 : (nrBlocks* bitsInBlock - nbits))
static constexpr bt MSU_MASK = (0 == nbits ? bt(0) : (ALL_ONES >> maxShift))
static constexpr bt SIGN_BIT_MASK = (0 == nbits ? bt(0) : (bt(bt(1) << ((nbits - 1ull) % bitsInBlock))))

Friends

template<unsigned N, typename B, BinaryNumberType T>
constexpr bool operator== (const blockbinary< N, B, T > &lhs, const blockbinary< N, B, T > &rhs)
template<unsigned N, typename B, BinaryNumberType T>
constexpr bool operator!= (const blockbinary< N, B, T > &lhs, const blockbinary< N, B, T > &rhs)

Member Typedef Documentation

◆ BlockType

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
typedef bt sw::universal::blockbinary< _nbits, bt, _NumberType >::BlockType

Constructor & Destructor Documentation

◆ blockbinary() [1/5]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
sw::universal::blockbinary< _nbits, bt, _NumberType >::blockbinary ( )
default

trivial constructor

◆ blockbinary() [2/5]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
template<unsigned nnbits>
sw::universal::blockbinary< _nbits, bt, _NumberType >::blockbinary ( const blockbinary< nnbits, BlockType, NumberType > & rhs)
inlineconstexpr

construct a blockbinary from another: bt must be the same

◆ blockbinary() [3/5]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
sw::universal::blockbinary< _nbits, bt, _NumberType >::blockbinary ( long long initial_value)
inlineconstexprnoexcept

◆ blockbinary() [4/5]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
sw::universal::blockbinary< _nbits, bt, _NumberType >::blockbinary ( const std::string & s)
inlineexplicitconstexprnoexcept

◆ blockbinary() [5/5]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
sw::universal::blockbinary< _nbits, bt, _NumberType >::blockbinary ( const SpecificValue code)
inlineconstexpr

Member Function Documentation

◆ all()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::all ( ) const
inlineconstexprnoexcept

◆ any() [1/2]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::any ( ) const
inlineconstexprnoexcept

◆ any() [2/2]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::any ( unsigned msb) const
inlineconstexpr

◆ anyAfter()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::anyAfter ( unsigned bitIndex) const
inlineconstexprnoexcept

◆ assign()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
template<unsigned srcbits>
blockbinary< nbits, bt, NumberType > & sw::universal::blockbinary< _nbits, bt, _NumberType >::assign ( const blockbinary< srcbits, bt, NumberType > & rhs)
inlineconstexpr

◆ assignWithoutSignExtend()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
template<unsigned srcbits>
blockbinary< nbits, bt, NumberType > & sw::universal::blockbinary< _nbits, bt, _NumberType >::assignWithoutSignExtend ( const blockbinary< srcbits, bt, NumberType > & rhs)
inlineconstexpr

◆ at()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::at ( unsigned bitIndex) const
inlineconstexprnoexcept

◆ block()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bt sw::universal::blockbinary< _nbits, bt, _NumberType >::block ( unsigned b) const
inlineconstexprnoexcept

◆ clear()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
void sw::universal::blockbinary< _nbits, bt, _NumberType >::clear ( )
inlineconstexprnoexcept

modifiers

◆ count()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
unsigned sw::universal::blockbinary< _nbits, bt, _NumberType >::count ( ) const
inlineconstexprnoexcept

◆ divide_by_zero()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::divide_by_zero ( )
inlineconstexpr

◆ flip()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::flip ( )
inlineconstexprnoexcept

◆ iseven()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::iseven ( ) const
inlineconstexprnoexcept

◆ isneg()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::isneg ( ) const
inlineconstexprnoexcept

◆ isodd()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::isodd ( ) const
inlineconstexprnoexcept

◆ ispos()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::ispos ( ) const
inlineconstexprnoexcept

◆ iszero()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::iszero ( ) const
inlineconstexprnoexcept

◆ maxneg()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::maxneg ( )
inlineconstexprnoexcept

◆ maxpos()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::maxpos ( )
inlineconstexprnoexcept

◆ minneg()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::minneg ( )
inlineconstexprnoexcept

◆ minpos()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::minpos ( )
inlineconstexprnoexcept

◆ msb()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
int sw::universal::blockbinary< _nbits, bt, _NumberType >::msb ( ) const
inlineconstexprnoexcept

◆ nibble()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
uint8_t sw::universal::blockbinary< _nbits, bt, _NumberType >::nibble ( unsigned n) const
inlineconstexprnoexcept

◆ none()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::none ( ) const
inlineconstexprnoexcept

◆ operator double()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
sw::universal::blockbinary< _nbits, bt, _NumberType >::operator double ( ) const
inlineexplicit

◆ operator float()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
sw::universal::blockbinary< _nbits, bt, _NumberType >::operator float ( ) const
inlineexplicit

◆ operator int()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
sw::universal::blockbinary< _nbits, bt, _NumberType >::operator int ( ) const
inlineexplicitconstexpr

◆ operator long()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
sw::universal::blockbinary< _nbits, bt, _NumberType >::operator long ( ) const
inlineexplicitconstexpr

◆ operator long long()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
sw::universal::blockbinary< _nbits, bt, _NumberType >::operator long long ( ) const
inlineexplicitconstexpr

◆ operator unsigned int()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
sw::universal::blockbinary< _nbits, bt, _NumberType >::operator unsigned int ( ) const
inlineexplicitconstexpr

◆ operator unsigned long()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
sw::universal::blockbinary< _nbits, bt, _NumberType >::operator unsigned long ( ) const
inlineexplicitconstexpr

◆ operator unsigned long long()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
sw::universal::blockbinary< _nbits, bt, _NumberType >::operator unsigned long long ( ) const
inlineexplicitconstexpr

◆ operator%=()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator%= ( const blockbinary< _nbits, bt, _NumberType > & rhs)
inlineconstexpr

◆ operator&=()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator&= ( const blockbinary< _nbits, bt, _NumberType > & rhs)
inlineconstexprnoexcept

◆ operator*=()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator*= ( const blockbinary< _nbits, bt, _NumberType > & rhs)
inlineconstexpr

◆ operator++() [1/2]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator++ ( )
inlineconstexpr

◆ operator++() [2/2]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary sw::universal::blockbinary< _nbits, bt, _NumberType >::operator++ ( int )
inlineconstexpr

◆ operator+=()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator+= ( const blockbinary< _nbits, bt, _NumberType > & rhs)
inlineconstexpr

◆ operator-()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary sw::universal::blockbinary< _nbits, bt, _NumberType >::operator- ( ) const
inlineconstexpr

◆ operator--() [1/2]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator-- ( )
inlineconstexpr

◆ operator--() [2/2]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary sw::universal::blockbinary< _nbits, bt, _NumberType >::operator-- ( int )
inlineconstexpr

◆ operator-=()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator-= ( const blockbinary< _nbits, bt, _NumberType > & rhs)
inlineconstexpr

◆ operator/=()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator/= ( const blockbinary< _nbits, bt, _NumberType > & rhs)
inlineconstexpr

◆ operator<<=()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator<<= ( int bitsToShift)
inlineconstexpr

◆ operator=()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator= ( long long rhs)
inlineconstexprnoexcept

◆ operator>>=()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator>>= ( int bitsToShift)
inlineconstexpr

◆ operator[]()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
BlockType sw::universal::blockbinary< _nbits, bt, _NumberType >::operator[] ( unsigned index) const
inlineconstexpr

◆ operator^=()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator^= ( const blockbinary< _nbits, bt, _NumberType > & rhs)
inlineconstexprnoexcept

◆ operator|=()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::operator|= ( const blockbinary< _nbits, bt, _NumberType > & rhs)
inlineconstexprnoexcept

logic operators

◆ operator~()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary sw::universal::blockbinary< _nbits, bt, _NumberType >::operator~ ( ) const
inlineconstexpr

◆ reset() [1/2]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
void sw::universal::blockbinary< _nbits, bt, _NumberType >::reset ( )
inlineconstexprnoexcept

◆ reset() [2/2]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
void sw::universal::blockbinary< _nbits, bt, _NumberType >::reset ( unsigned i)
inlineconstexprnoexcept

◆ roundingMode()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::roundingMode ( unsigned targetLsb) const
inlineconstexpr

◆ set() [1/2]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
void sw::universal::blockbinary< _nbits, bt, _NumberType >::set ( )
inlineconstexprnoexcept

◆ set() [2/2]

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
void sw::universal::blockbinary< _nbits, bt, _NumberType >::set ( unsigned i)
inlineconstexprnoexcept

◆ setbit()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
void sw::universal::blockbinary< _nbits, bt, _NumberType >::setbit ( unsigned i,
bool v = true )
inlineconstexprnoexcept

◆ setbits()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
void sw::universal::blockbinary< _nbits, bt, _NumberType >::setbits ( uint64_t value)
inlineconstexprnoexcept

◆ setblock()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
void sw::universal::blockbinary< _nbits, bt, _NumberType >::setblock ( unsigned b,
const bt & blockBits )
inlineconstexprnoexcept

◆ setzero()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
void sw::universal::blockbinary< _nbits, bt, _NumberType >::setzero ( )
inlineconstexprnoexcept

◆ sign()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::sign ( ) const
inlineconstexprnoexcept

◆ test()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bool sw::universal::blockbinary< _nbits, bt, _NumberType >::test ( unsigned bitIndex) const
inlineconstexprnoexcept

◆ to_native()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
template<typename Real, typename = typename std::enable_if< std::is_floating_point<Real>::value, Real >::type>
Real sw::universal::blockbinary< _nbits, bt, _NumberType >::to_native ( ) const
inline

◆ to_sll()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
int64_t sw::universal::blockbinary< _nbits, bt, _NumberType >::to_sll ( ) const
inlineconstexpr

◆ to_ull()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
uint64_t sw::universal::blockbinary< _nbits, bt, _NumberType >::to_ull ( ) const
inlineconstexpr

◆ twosComplement()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::twosComplement ( )
inlineconstexprnoexcept

in-place 2's complement

Returns
2's complement of original

◆ zero()

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
blockbinary & sw::universal::blockbinary< _nbits, bt, _NumberType >::zero ( )
inlineconstexprnoexcept

◆ operator!=

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
template<unsigned N, typename B, BinaryNumberType T>
bool operator!= ( const blockbinary< N, B, T > & lhs,
const blockbinary< N, B, T > & rhs )
friend

◆ operator==

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
template<unsigned N, typename B, BinaryNumberType T>
bool operator== ( const blockbinary< N, B, T > & lhs,
const blockbinary< N, B, T > & rhs )
friend

Member Data Documentation

◆ ALL_ONES

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bt sw::universal::blockbinary< _nbits, bt, _NumberType >::ALL_ONES = bt(~0)
staticconstexpr

◆ bitsInBlock

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
unsigned sw::universal::blockbinary< _nbits, bt, _NumberType >::bitsInBlock = sizeof(bt) * bitsInByte
staticconstexpr

◆ bitsInByte

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
unsigned sw::universal::blockbinary< _nbits, bt, _NumberType >::bitsInByte = 8
staticconstexpr

◆ maxBlockValue

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bt sw::universal::blockbinary< _nbits, bt, _NumberType >::maxBlockValue = bt(-1)
staticconstexpr

◆ maxShift

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
unsigned sw::universal::blockbinary< _nbits, bt, _NumberType >::maxShift = (0 == nbits ? 0 : (nrBlocks* bitsInBlock - nbits))
staticconstexpr

◆ MSU

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
unsigned sw::universal::blockbinary< _nbits, bt, _NumberType >::MSU = nrBlocks - 1
staticconstexpr

◆ MSU_MASK

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bt sw::universal::blockbinary< _nbits, bt, _NumberType >::MSU_MASK = (0 == nbits ? bt(0) : (ALL_ONES >> maxShift))
staticconstexpr

◆ nbits

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
unsigned sw::universal::blockbinary< _nbits, bt, _NumberType >::nbits = _nbits
staticconstexpr

◆ nrBlocks

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
unsigned sw::universal::blockbinary< _nbits, bt, _NumberType >::nrBlocks = (0 == nbits ? 1 : (1ull + ((nbits - 1ull) / bitsInBlock)))
staticconstexpr

◆ NumberType

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
BinaryNumberType sw::universal::blockbinary< _nbits, bt, _NumberType >::NumberType = _NumberType
staticconstexpr

◆ SIGN_BIT_MASK

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
bt sw::universal::blockbinary< _nbits, bt, _NumberType >::SIGN_BIT_MASK = (0 == nbits ? bt(0) : (bt(bt(1) << ((nbits - 1ull) % bitsInBlock))))
staticconstexpr

◆ storageMask

template<unsigned _nbits, typename bt = uint8_t, BinaryNumberType _NumberType = BinaryNumberType::Signed>
uint64_t sw::universal::blockbinary< _nbits, bt, _NumberType >::storageMask = (0xFFFFFFFFFFFFFFFFull >> (64 - bitsInBlock))
staticconstexpr

The documentation for this class was generated from the following file:
  • /home/runner/work/universal/universal/include/sw/universal/internal/blockbinary/blockbinary.hpp