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::hfloat< _ndigits, _es, bt > Class Template Reference

#include <hfloat_impl.hpp>

Public Types

typedef bt BlockType
using frac_t = hfloat_detail::wide<fbits>
using raw_t = hfloat_detail::wide<nbits>

Public Member Functions

 hfloat ()=default
 trivial constructor
 hfloat (const hfloat &)=default
 hfloat (hfloat &&)=default
hfloat & operator= (const hfloat &)=default
hfloat & operator= (hfloat &&)=default
constexpr hfloat (const SpecificValue code) noexcept
constexpr hfloat (signed char iv) noexcept
constexpr hfloat (short iv) noexcept
constexpr hfloat (int iv) noexcept
constexpr hfloat (long iv) noexcept
constexpr hfloat (long long iv) noexcept
constexpr hfloat (char iv) noexcept
constexpr hfloat (unsigned short iv) noexcept
constexpr hfloat (unsigned int iv) noexcept
constexpr hfloat (unsigned long iv) noexcept
constexpr hfloat (unsigned long long iv) noexcept
constexpr hfloat (float iv) noexcept
constexpr hfloat (double iv) noexcept
constexpr hfloat & operator= (signed char rhs) noexcept
constexpr hfloat & operator= (short rhs) noexcept
constexpr hfloat & operator= (int rhs) noexcept
constexpr hfloat & operator= (long rhs) noexcept
constexpr hfloat & operator= (long long rhs) noexcept
constexpr hfloat & operator= (char rhs) noexcept
constexpr hfloat & operator= (unsigned short rhs) noexcept
constexpr hfloat & operator= (unsigned int rhs) noexcept
constexpr hfloat & operator= (unsigned long rhs) noexcept
constexpr hfloat & operator= (unsigned long long rhs) noexcept
constexpr hfloat & operator= (float rhs) noexcept
constexpr hfloat & operator= (double rhs) noexcept
constexpr operator float () const noexcept
constexpr operator double () const noexcept
constexpr hfloat & assign_from_mantissa64 (bool negative, int bin_exp, uint64_t mantissa64) noexcept
template<unsigned BigBits>
constexpr hfloat & assign_from_wide_mantissa (bool negative, int bin_exp, const ::sw::universal::decimal_to_binary::basic_result< BigBits > &d) noexcept
constexpr hfloat operator- () const
constexpr hfloat & operator+= (const hfloat &rhs)
constexpr hfloat & operator-= (const hfloat &rhs)
constexpr hfloat & operator*= (const hfloat &rhs)
constexpr hfloat & operator/= (const hfloat &rhs)
constexpr hfloat & operator++ ()
constexpr hfloat operator++ (int)
constexpr hfloat & operator-- ()
constexpr hfloat operator-- (int)
constexpr void clear () noexcept
constexpr void setzero () noexcept
constexpr void setsign (bool negative=true) noexcept
constexpr void setbits (uint64_t value) noexcept
constexpr hfloat & maxpos () noexcept
constexpr hfloat & minpos () noexcept
constexpr hfloat & zero () noexcept
constexpr hfloat & minneg () noexcept
constexpr hfloat & maxneg () noexcept
constexpr bool sign () const noexcept
constexpr bool iszero () const noexcept
constexpr bool isone () const noexcept
constexpr bool ispos () const noexcept
constexpr bool isneg () const noexcept
constexpr bool isinf () const noexcept
constexpr bool isnan () const noexcept
constexpr bool isnan (int) const noexcept
constexpr int scale () const noexcept
std::string str (size_t nrDigits=0) const
constexpr bool getbit (unsigned pos) const noexcept
constexpr void decode (bool &s, int &exponent, frac_t &fraction) const noexcept
constexpr void decode_normalized (bool &s, int &exponent, frac_t &fraction) const noexcept
constexpr void unpack (bool &s, int &exponent, uint64_t &fraction) const noexcept

Static Public Attributes

static constexpr unsigned ndigits = _ndigits
static constexpr unsigned es = _es
static constexpr unsigned fbits = ndigits * 4u
static constexpr unsigned nbits = 1u + es + fbits
static constexpr int bias = (1 << (es - 1))
static constexpr int emax = (1 << es) - 1 - bias
static constexpr int emin = -bias
static constexpr unsigned bitsInByte = 8u
static constexpr unsigned bitsInBlock = sizeof(bt) * bitsInByte
static constexpr unsigned nrBlocks = 1u + ((nbits - 1u) / bitsInBlock)
static constexpr unsigned MSU = nrBlocks - 1u
static constexpr bt ALL_ONES = bt(~0)
static constexpr bt MSU_MASK = (nrBlocks * bitsInBlock == nbits) ? ALL_ONES : bt((1ull << (nbits % bitsInBlock)) - 1u)
static constexpr bt BLOCK_MASK = bt(~0)
static constexpr unsigned wide64 = (fbits > 64u) ? fbits : 64u

Protected Member Functions

constexpr void setbit (unsigned pos, bool value) noexcept
constexpr raw_t load () const noexcept
constexpr void store (const raw_t &r) noexcept
template<unsigned C>
constexpr void encode (bool s, int exponent, const hfloat_detail::wide< C > &F) noexcept
template<unsigned C>
constexpr void normalize_chop (bool s, int e, hfloat_detail::wide< C > f, int P) noexcept
constexpr hfloat & convert_ieee754 (double rhs) noexcept
constexpr double convert_to_double () const noexcept
constexpr hfloat & convert_long_double (long double rhs) noexcept
constexpr hfloat & convert_signed (int64_t v) noexcept
constexpr hfloat & convert_unsigned (uint64_t v) noexcept
constexpr hfloat & assign_scaled (bool negative, uint64_t m, int E) noexcept

Static Protected Member Functions

static constexpr int floor_div4 (int b) noexcept

Protected Attributes

bt _block [nrBlocks]

Friends

template<unsigned N, unsigned E, typename B>
constexpr bool operator== (const hfloat< N, E, B > &lhs, const hfloat< N, E, B > &rhs)
template<unsigned N, unsigned E, typename B>
constexpr bool operator== (const hfloat< N, E, B > &lhs, const double rhs)
template<unsigned N, unsigned E, typename B>
constexpr bool operator== (const double lhs, const hfloat< N, E, B > &rhs)

Member Typedef Documentation

◆ BlockType

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
typedef bt sw::universal::hfloat< _ndigits, _es, bt >::BlockType

◆ frac_t

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
using sw::universal::hfloat< _ndigits, _es, bt >::frac_t = hfloat_detail::wide<fbits>

◆ raw_t

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
using sw::universal::hfloat< _ndigits, _es, bt >::raw_t = hfloat_detail::wide<nbits>

Constructor & Destructor Documentation

◆ hfloat() [1/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( )
default

trivial constructor

◆ hfloat() [2/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( const hfloat< _ndigits, _es, bt > & )
default

◆ hfloat() [3/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( hfloat< _ndigits, _es, bt > && )
default

◆ hfloat() [4/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( const SpecificValue code)
inlineconstexprnoexcept

◆ hfloat() [5/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( signed char iv)
inlineexplicitconstexprnoexcept

◆ hfloat() [6/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( short iv)
inlineexplicitconstexprnoexcept

◆ hfloat() [7/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( int iv)
inlineexplicitconstexprnoexcept

◆ hfloat() [8/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( long iv)
inlineexplicitconstexprnoexcept

◆ hfloat() [9/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( long long iv)
inlineexplicitconstexprnoexcept

◆ hfloat() [10/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( char iv)
inlineexplicitconstexprnoexcept

◆ hfloat() [11/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( unsigned short iv)
inlineexplicitconstexprnoexcept

◆ hfloat() [12/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( unsigned int iv)
inlineexplicitconstexprnoexcept

◆ hfloat() [13/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( unsigned long iv)
inlineexplicitconstexprnoexcept

◆ hfloat() [14/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( unsigned long long iv)
inlineexplicitconstexprnoexcept

◆ hfloat() [15/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( float iv)
inlineexplicitconstexprnoexcept

◆ hfloat() [16/16]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::hfloat ( double iv)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ assign_from_mantissa64()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::assign_from_mantissa64 ( bool negative,
int bin_exp,
uint64_t mantissa64 )
inlineconstexprnoexcept

◆ assign_from_wide_mantissa()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
template<unsigned BigBits>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::assign_from_wide_mantissa ( bool negative,
int bin_exp,
const ::sw::universal::decimal_to_binary::basic_result< BigBits > & d )
inlineconstexprnoexcept

◆ assign_scaled()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::assign_scaled ( bool negative,
uint64_t m,
int E )
inlineconstexprprotectednoexcept

◆ clear()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
void sw::universal::hfloat< _ndigits, _es, bt >::clear ( )
inlineconstexprnoexcept

◆ convert_ieee754()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::convert_ieee754 ( double rhs)
inlineconstexprprotectednoexcept

◆ convert_long_double()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::convert_long_double ( long double rhs)
inlineconstexprprotectednoexcept

◆ convert_signed()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::convert_signed ( int64_t v)
inlineconstexprprotectednoexcept

◆ convert_to_double()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
double sw::universal::hfloat< _ndigits, _es, bt >::convert_to_double ( ) const
inlineconstexprprotectednoexcept

◆ convert_unsigned()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::convert_unsigned ( uint64_t v)
inlineconstexprprotectednoexcept

◆ decode()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
void sw::universal::hfloat< _ndigits, _es, bt >::decode ( bool & s,
int & exponent,
frac_t & fraction ) const
inlineconstexprnoexcept

◆ decode_normalized()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
void sw::universal::hfloat< _ndigits, _es, bt >::decode_normalized ( bool & s,
int & exponent,
frac_t & fraction ) const
inlineconstexprnoexcept

◆ encode()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
template<unsigned C>
void sw::universal::hfloat< _ndigits, _es, bt >::encode ( bool s,
int exponent,
const hfloat_detail::wide< C > & F )
inlineconstexprprotectednoexcept

◆ floor_div4()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
constexpr int sw::universal::hfloat< _ndigits, _es, bt >::floor_div4 ( int b)
inlinestaticconstexprprotectednoexcept

◆ getbit()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bool sw::universal::hfloat< _ndigits, _es, bt >::getbit ( unsigned pos) const
inlineconstexprnoexcept

◆ isinf()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bool sw::universal::hfloat< _ndigits, _es, bt >::isinf ( ) const
inlineconstexprnoexcept

◆ isnan() [1/2]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bool sw::universal::hfloat< _ndigits, _es, bt >::isnan ( ) const
inlineconstexprnoexcept

◆ isnan() [2/2]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bool sw::universal::hfloat< _ndigits, _es, bt >::isnan ( int ) const
inlineconstexprnoexcept

◆ isneg()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bool sw::universal::hfloat< _ndigits, _es, bt >::isneg ( ) const
inlineconstexprnoexcept

◆ isone()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bool sw::universal::hfloat< _ndigits, _es, bt >::isone ( ) const
inlineconstexprnoexcept

◆ ispos()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bool sw::universal::hfloat< _ndigits, _es, bt >::ispos ( ) const
inlineconstexprnoexcept

◆ iszero()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bool sw::universal::hfloat< _ndigits, _es, bt >::iszero ( ) const
inlineconstexprnoexcept

◆ load()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
raw_t sw::universal::hfloat< _ndigits, _es, bt >::load ( ) const
inlineconstexprprotectednoexcept

◆ maxneg()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::maxneg ( )
inlineconstexprnoexcept

◆ maxpos()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::maxpos ( )
inlineconstexprnoexcept

◆ minneg()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::minneg ( )
inlineconstexprnoexcept

◆ minpos()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::minpos ( )
inlineconstexprnoexcept

◆ normalize_chop()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
template<unsigned C>
void sw::universal::hfloat< _ndigits, _es, bt >::normalize_chop ( bool s,
int e,
hfloat_detail::wide< C > f,
int P )
inlineconstexprprotectednoexcept

◆ operator double()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::operator double ( ) const
inlineexplicitconstexprnoexcept

◆ operator float()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
sw::universal::hfloat< _ndigits, _es, bt >::operator float ( ) const
inlineexplicitconstexprnoexcept

◆ operator*=()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator*= ( const hfloat< _ndigits, _es, bt > & rhs)
inlineconstexpr

◆ operator++() [1/2]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator++ ( )
inlineconstexpr

◆ operator++() [2/2]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat sw::universal::hfloat< _ndigits, _es, bt >::operator++ ( int )
inlineconstexpr

◆ operator+=()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator+= ( const hfloat< _ndigits, _es, bt > & rhs)
inlineconstexpr

◆ operator-()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat sw::universal::hfloat< _ndigits, _es, bt >::operator- ( ) const
inlineconstexpr

◆ operator--() [1/2]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator-- ( )
inlineconstexpr

◆ operator--() [2/2]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat sw::universal::hfloat< _ndigits, _es, bt >::operator-- ( int )
inlineconstexpr

◆ operator-=()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator-= ( const hfloat< _ndigits, _es, bt > & rhs)
inlineconstexpr

◆ operator/=()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator/= ( const hfloat< _ndigits, _es, bt > & rhs)
inlineconstexpr

◆ operator=() [1/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( char rhs)
inlineconstexprnoexcept

◆ operator=() [2/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( const hfloat< _ndigits, _es, bt > & )
default

◆ operator=() [3/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( double rhs)
inlineconstexprnoexcept

◆ operator=() [4/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( float rhs)
inlineconstexprnoexcept

◆ operator=() [5/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( hfloat< _ndigits, _es, bt > && )
default

◆ operator=() [6/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( int rhs)
inlineconstexprnoexcept

◆ operator=() [7/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( long long rhs)
inlineconstexprnoexcept

◆ operator=() [8/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( long rhs)
inlineconstexprnoexcept

◆ operator=() [9/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( short rhs)
inlineconstexprnoexcept

◆ operator=() [10/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( signed char rhs)
inlineconstexprnoexcept

◆ operator=() [11/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( unsigned int rhs)
inlineconstexprnoexcept

◆ operator=() [12/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( unsigned long long rhs)
inlineconstexprnoexcept

◆ operator=() [13/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( unsigned long rhs)
inlineconstexprnoexcept

◆ operator=() [14/14]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::operator= ( unsigned short rhs)
inlineconstexprnoexcept

◆ scale()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
int sw::universal::hfloat< _ndigits, _es, bt >::scale ( ) const
inlineconstexprnoexcept

◆ setbit()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
void sw::universal::hfloat< _ndigits, _es, bt >::setbit ( unsigned pos,
bool value )
inlineconstexprprotectednoexcept

◆ setbits()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
void sw::universal::hfloat< _ndigits, _es, bt >::setbits ( uint64_t value)
inlineconstexprnoexcept

◆ setsign()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
void sw::universal::hfloat< _ndigits, _es, bt >::setsign ( bool negative = true)
inlineconstexprnoexcept

◆ setzero()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
void sw::universal::hfloat< _ndigits, _es, bt >::setzero ( )
inlineconstexprnoexcept

◆ sign()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bool sw::universal::hfloat< _ndigits, _es, bt >::sign ( ) const
inlineconstexprnoexcept

◆ store()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
void sw::universal::hfloat< _ndigits, _es, bt >::store ( const raw_t & r)
inlineconstexprprotectednoexcept

◆ str()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
std::string sw::universal::hfloat< _ndigits, _es, bt >::str ( size_t nrDigits = 0) const
inline

◆ unpack()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
void sw::universal::hfloat< _ndigits, _es, bt >::unpack ( bool & s,
int & exponent,
uint64_t & fraction ) const
inlineconstexprnoexcept

◆ zero()

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
hfloat & sw::universal::hfloat< _ndigits, _es, bt >::zero ( )
inlineconstexprnoexcept

◆ operator== [1/3]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
template<unsigned N, unsigned E, typename B>
bool operator== ( const double lhs,
const hfloat< N, E, B > & rhs )
friend

◆ operator== [2/3]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
template<unsigned N, unsigned E, typename B>
bool operator== ( const hfloat< N, E, B > & lhs,
const double rhs )
friend

◆ operator== [3/3]

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
template<unsigned N, unsigned E, typename B>
bool operator== ( const hfloat< N, E, B > & lhs,
const hfloat< N, E, B > & rhs )
friend

Member Data Documentation

◆ _block

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bt sw::universal::hfloat< _ndigits, _es, bt >::_block[nrBlocks]
protected

◆ ALL_ONES

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bt sw::universal::hfloat< _ndigits, _es, bt >::ALL_ONES = bt(~0)
staticconstexpr

◆ bias

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
int sw::universal::hfloat< _ndigits, _es, bt >::bias = (1 << (es - 1))
staticconstexpr

◆ bitsInBlock

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
unsigned sw::universal::hfloat< _ndigits, _es, bt >::bitsInBlock = sizeof(bt) * bitsInByte
staticconstexpr

◆ bitsInByte

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
unsigned sw::universal::hfloat< _ndigits, _es, bt >::bitsInByte = 8u
staticconstexpr

◆ BLOCK_MASK

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bt sw::universal::hfloat< _ndigits, _es, bt >::BLOCK_MASK = bt(~0)
staticconstexpr

◆ emax

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
int sw::universal::hfloat< _ndigits, _es, bt >::emax = (1 << es) - 1 - bias
staticconstexpr

◆ emin

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
int sw::universal::hfloat< _ndigits, _es, bt >::emin = -bias
staticconstexpr

◆ es

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
unsigned sw::universal::hfloat< _ndigits, _es, bt >::es = _es
staticconstexpr

◆ fbits

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
unsigned sw::universal::hfloat< _ndigits, _es, bt >::fbits = ndigits * 4u
staticconstexpr

◆ MSU

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
unsigned sw::universal::hfloat< _ndigits, _es, bt >::MSU = nrBlocks - 1u
staticconstexpr

◆ MSU_MASK

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
bt sw::universal::hfloat< _ndigits, _es, bt >::MSU_MASK = (nrBlocks * bitsInBlock == nbits) ? ALL_ONES : bt((1ull << (nbits % bitsInBlock)) - 1u)
staticconstexpr

◆ nbits

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
unsigned sw::universal::hfloat< _ndigits, _es, bt >::nbits = 1u + es + fbits
staticconstexpr

◆ ndigits

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
unsigned sw::universal::hfloat< _ndigits, _es, bt >::ndigits = _ndigits
staticconstexpr

◆ nrBlocks

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
unsigned sw::universal::hfloat< _ndigits, _es, bt >::nrBlocks = 1u + ((nbits - 1u) / bitsInBlock)
staticconstexpr

◆ wide64

template<unsigned _ndigits, unsigned _es, typename bt = std::uint32_t>
unsigned sw::universal::hfloat< _ndigits, _es, bt >::wide64 = (fbits > 64u) ? fbits : 64u
staticconstexpr

The documentation for this class was generated from the following files:
  • /home/runner/work/universal/universal/include/sw/universal/number/hfloat/hfloat_fwd.hpp
  • /home/runner/work/universal/universal/include/sw/universal/number/hfloat/hfloat_impl.hpp