30 operator float()
const 37 m_Value = other.
Val();
49 return m_Value == r.
Val();
72 const uint32_t* u32 =
reinterpret_cast<const uint32_t*
>(&v);
73 uint16_t u16 =
static_cast<uint16_t
>(*u32 >> 16u);
75 const uint16_t lsb = u16 & 0x0001;
77 const uint16_t
error =
static_cast<const uint16_t
>((*u32 & 0x0000FFFF));
78 if ((error > 0x8000 || (error == 0x8000 && lsb == 1)))
89 const uint32_t u32 =
static_cast<const uint32_t
>(m_Value << 16u);
90 const float* f32 =
reinterpret_cast<const float*
>(&u32);
101 uint16_t max = 0x7F7F;
107 uint16_t nan = 0x7FC0;
113 uint16_t infVal = 0x7F80;
123 os << b.
ToFloat32() <<
"(0x" << std::hex << b.
Val() <<
")";
BFloat16 & operator=(const BFloat16 &other)
std::ostream & operator<<(std::ostream &os, const std::vector< Compute > &compute)
Deprecated function that will be removed together with the Compute enum.
BFloat16 & operator=(float v)
Copyright (c) 2020 ARM Limited.
static BFloat16 Float32ToBFloat16(const float v)
bool operator==(const BFloat16 &r) const