一呼百應, "one call, a hundred responses"
Loading...
Searching...
No Matches
ein::bf16 Struct Reference

#include <bf16.hpp>

Public Types

using underlying_type = __bf16
 

Public Member Functions

constexpr bf16 () noexcept=default
 
constexpr bf16 (float f) noexcept
 
constexpr bf16 (__bf16 f) noexcept
 
constexpr bf16 (bf16 const &) noexcept=default
 
constexpr bf16 (bf16 &&) noexcept=default
 
constexpr operator __bf16 (this bf16 self) noexcept
 
constexpr operator float (this bf16 self) noexcept
 
ein_reinitializes constexpr bf16operator= (bf16 const &) noexcept=default
 
ein_reinitializes constexpr bf16operator= (bf16 &&) noexcept=default
 
constexpr uint16_t to_bits (this bf16 self) noexcept
 

Static Public Member Functions

static constexpr bf16 from_bits (uint16_t data) noexcept
 

Public Attributes

__bf16 content
 

Friends

constexpr bool operator== (bf16 x, bf16 y) noexcept
 
constexpr std::partial_ordering operator<=> (bf16 x, bf16 y) noexcept
 
constexpr bool operator!= (bf16 x, bf16 y) noexcept
 
constexpr bool operator< (bf16 x, bf16 y) noexcept
 
constexpr bool operator> (bf16 x, bf16 y) noexcept
 
constexpr bool operator<= (bf16 x, bf16 y) noexcept
 
constexpr bool operator>= (bf16 x, bf16 y) noexcept
 
constexpr void swap (bf16 &x, bf16 &y) noexcept
 

Detailed Description

Definition at line 19 of file bf16.hpp.

Member Typedef Documentation

◆ underlying_type

Definition at line 20 of file bf16.hpp.

Constructor & Destructor Documentation

◆ bf16() [1/5]

ein::bf16::bf16 ( )
constexprdefaultnoexcept[[always_inline]][[artificial]]

◆ bf16() [2/5]

ein::bf16::bf16 ( float f)
inlineconstexprnoexcept[[always_inline]][[artificial]]

Definition at line 28 of file bf16.hpp.

28: content(f) {}
__bf16 content
Definition bf16.hpp:22

◆ bf16() [3/5]

ein::bf16::bf16 ( __bf16 f)
inlineconstexprnoexcept[[always_inline]][[artificial]]

Definition at line 31 of file bf16.hpp.

31: content(f) {}

◆ bf16() [4/5]

ein::bf16::bf16 ( bf16 const & )
constexprdefaultnoexcept[[always_inline]][[artificial]][[noescape]]

◆ bf16() [5/5]

ein::bf16::bf16 ( bf16 && )
constexprdefaultnoexcept[[always_inline]][[artificial]][[noescape]]

Member Function Documentation

◆ from_bits()

static constexpr bf16 ein::bf16::from_bits ( uint16_t data)
inlinestaticconstexprnoexcept[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 98 of file bf16.hpp.

98 {
99 return std::bit_cast<bf16>(data);
100 }

Referenced by std::numeric_limits< ein::bf16 >::epsilon(), std::numeric_limits< ein::bf16 >::infinity(), std::numeric_limits< ein::bf16 >::lowest(), std::numeric_limits< ein::bf16 >::max(), std::numeric_limits< ein::bf16 >::min(), std::numeric_limits< ein::bf16 >::quiet_NaN(), std::numeric_limits< ein::bf16 >::round_error(), and std::numeric_limits< ein::bf16 >::signaling_NaN().

Here is the caller graph for this function:

◆ operator __bf16()

ein::bf16::operator __bf16 ( this bf16 self)
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 40 of file bf16.hpp.

40{ return self.content; }

◆ operator float()

ein::bf16::operator float ( this bf16 self)
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 43 of file bf16.hpp.

43{ return self.content; }

◆ operator=() [1/2]

ein_reinitializes constexpr bf16 & ein::bf16::operator= ( bf16 && )
constexprdefaultnoexcept[[always_inline]][[artificial]][[noescape]][[lifetimebound]]

◆ operator=() [2/2]

ein_reinitializes constexpr bf16 & ein::bf16::operator= ( bf16 const & )
constexprdefaultnoexcept[[always_inline]][[artificial]][[noescape]][[lifetimebound]]

◆ to_bits()

uint16_t ein::bf16::to_bits ( this bf16 self)
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[const]]

Definition at line 103 of file bf16.hpp.

103 {
104 return std::bit_cast<uint16_t>(self.content);
105 }

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( bf16 x,
bf16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 64 of file bf16.hpp.

64 {
65 return x.content != y.content;
66 }

◆ operator<

bool operator< ( bf16 x,
bf16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 69 of file bf16.hpp.

69 {
70 return x.content < y.content;
71 }

◆ operator<=

bool operator<= ( bf16 x,
bf16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 79 of file bf16.hpp.

79 {
80 return x.content <= y.content;
81 }

◆ operator<=>

std::partial_ordering operator<=> ( bf16 x,
bf16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 59 of file bf16.hpp.

59 {
60 return x.content <=> y.content;
61 }

◆ operator==

bool operator== ( bf16 x,
bf16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 54 of file bf16.hpp.

54 {
55 return x.content == y.content;
56 }

◆ operator>

bool operator> ( bf16 x,
bf16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 74 of file bf16.hpp.

74 {
75 return x.content > y.content;
76 }

◆ operator>=

bool operator>= ( bf16 x,
bf16 y )
friend[[nodiscard]][[always_inline]][[artificial]][[const]]

Definition at line 84 of file bf16.hpp.

84 {
85 return x.content >= y.content;
86 }

◆ swap

void swap ( bf16 & x,
bf16 & y )
friend[[always_inline]][[artificial]][[noescape]]

Definition at line 89 of file bf16.hpp.

92 {
93 using std::swap;
94 swap(x.content,y.content);
95 }
friend constexpr void swap(bf16 &x, bf16 &y) noexcept
Definition bf16.hpp:89

Member Data Documentation

◆ content

__bf16 ein::bf16::content

Definition at line 22 of file bf16.hpp.


The documentation for this struct was generated from the following file: