|
Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
|
#include <bfloat16_impl.hpp>
Public Member Functions | |
| bfloat16 ()=default | |
| constexpr | bfloat16 (const bfloat16 &)=default |
| constexpr | bfloat16 (bfloat16 &&)=default |
| constexpr bfloat16 & | operator= (const bfloat16 &)=default |
| constexpr bfloat16 & | operator= (bfloat16 &&)=default |
| constexpr | bfloat16 (const SpecificValue code) noexcept |
| BIT_CAST_CONSTEXPR | bfloat16 (signed char iv) noexcept |
| BIT_CAST_CONSTEXPR | bfloat16 (short iv) noexcept |
| BIT_CAST_CONSTEXPR | bfloat16 (int iv) noexcept |
| BIT_CAST_CONSTEXPR | bfloat16 (long iv) noexcept |
| BIT_CAST_CONSTEXPR | bfloat16 (long long iv) noexcept |
| BIT_CAST_CONSTEXPR | bfloat16 (char iv) noexcept |
| BIT_CAST_CONSTEXPR | bfloat16 (unsigned short iv) noexcept |
| BIT_CAST_CONSTEXPR | bfloat16 (unsigned int iv) noexcept |
| BIT_CAST_CONSTEXPR | bfloat16 (unsigned long iv) noexcept |
| BIT_CAST_CONSTEXPR | bfloat16 (unsigned long long iv) noexcept |
| BIT_CAST_CONSTEXPR | bfloat16 (float iv) noexcept |
| BIT_CAST_CONSTEXPR | bfloat16 (double iv) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator= (signed char rhs) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator= (short rhs) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator= (int rhs) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator= (long rhs) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator= (long long rhs) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator= (char rhs) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator= (unsigned short rhs) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator= (unsigned int rhs) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator= (unsigned long rhs) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator= (unsigned long long rhs) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator= (float rhs) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator= (double rhs) noexcept |
| template<typename Integer> | |
| BIT_CAST_CONSTEXPR Integer | to_integer () const noexcept |
| BIT_CAST_CONSTEXPR | operator signed char () const noexcept |
| BIT_CAST_CONSTEXPR | operator short () const noexcept |
| BIT_CAST_CONSTEXPR | operator int () const noexcept |
| BIT_CAST_CONSTEXPR | operator long () const noexcept |
| BIT_CAST_CONSTEXPR | operator long long () const noexcept |
| BIT_CAST_CONSTEXPR | operator char () const noexcept |
| BIT_CAST_CONSTEXPR | operator unsigned short () const noexcept |
| BIT_CAST_CONSTEXPR | operator unsigned int () const noexcept |
| BIT_CAST_CONSTEXPR | operator unsigned long () const noexcept |
| BIT_CAST_CONSTEXPR | operator unsigned long long () const noexcept |
| BIT_CAST_CONSTEXPR | operator float () const noexcept |
| BIT_CAST_CONSTEXPR | operator double () const noexcept |
| constexpr bfloat16 | operator- () const noexcept |
| constexpr bfloat16 & | operator++ () noexcept |
| constexpr bfloat16 | operator++ (int) noexcept |
| constexpr bfloat16 & | operator-- () noexcept |
| constexpr bfloat16 | operator-- (int) noexcept |
| BIT_CAST_CONSTEXPR bfloat16 & | operator+= (const bfloat16 &rhs) |
| BIT_CAST_CONSTEXPR bfloat16 & | operator-= (const bfloat16 &rhs) |
| BIT_CAST_CONSTEXPR bfloat16 & | operator*= (const bfloat16 &rhs) |
| BIT_CAST_CONSTEXPR bfloat16 & | operator/= (const bfloat16 &rhs) |
| constexpr void | clear () noexcept |
| constexpr void | setzero () noexcept |
| constexpr void | setnan (int NaNType=NAN_TYPE_SIGNALLING) noexcept |
| constexpr void | setinf (bool sign=false) noexcept |
| constexpr void | setbit (unsigned i, bool v=true) noexcept |
| constexpr void | setbits (unsigned value) noexcept |
| constexpr bfloat16 & | minpos () noexcept |
| constexpr bfloat16 & | maxpos () noexcept |
| constexpr bfloat16 & | zero () noexcept |
| constexpr bfloat16 & | minneg () noexcept |
| constexpr bfloat16 & | maxneg () noexcept |
| bfloat16 & | assign (const std::string &str) noexcept |
| assign an encoding given as a binary string | |
| constexpr bool | iszero () const noexcept |
| constexpr bool | isone () const noexcept |
| constexpr bool | isodd () const noexcept |
| constexpr bool | iseven () const noexcept |
| bool | isinteger () const noexcept |
| constexpr bool | ispos () const noexcept |
| constexpr bool | isneg () const noexcept |
| constexpr bool | isnan (int NaNType=NAN_TYPE_EITHER) const noexcept |
| constexpr bool | isinf (int InfType=INF_TYPE_EITHER) const noexcept |
| constexpr bool | sign () const noexcept |
| constexpr int | scale () const noexcept |
| constexpr unsigned short | bits () 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 uint8_t | exponent () const noexcept |
| constexpr uint8_t | fraction () const noexcept |
Static Public Attributes | |
| static constexpr unsigned | nbits = 16 |
| static constexpr unsigned | es = 8 |
| static constexpr unsigned | fbits = nbits - 1u - es |
Protected Attributes | |
| unsigned short | _bits |
Friends | |
| constexpr bool | operator== (bfloat16 lhs, bfloat16 rhs) |
| BIT_CAST_CONSTEXPR bool | operator== (bfloat16 lhs, float rhs) |
| BIT_CAST_CONSTEXPR bool | operator== (float lhs, bfloat16 rhs) |
|
default |
|
constexprdefault |
|
constexprdefault |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
assign an encoding given as a binary string
| str | "0b", then the sign, exponent and fraction bits with the three fields separated by '.'; ' may separate digits. The bit count must match the type. |
Clang doesn't support constexpr yet on string manipulations, so we need to make it conditional
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inline |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inline |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
friend |
|
friend |
|
protected |
|
staticconstexpr |
|
staticconstexpr |