32 operator float()
const 47 return m_Value == r.
Val();
70 const uint32_t* u32 =
reinterpret_cast<const uint32_t*
>(&v);
71 uint16_t u16 =
static_cast<uint16_t
>(*u32 >> 16u);
73 const uint16_t lsb = u16 & 0x0001;
75 const uint16_t
error =
static_cast<uint16_t
>((*u32 & 0x0000FFFF));
76 if ((error > 0x8000 || (error == 0x8000 && lsb == 1)))
87 const uint32_t u32 =
static_cast<uint32_t
>(m_Value << 16u);
88 const float* f32 =
reinterpret_cast<const float*
>(&u32);
99 uint16_t max = 0x7F7F;
105 uint16_t nan = 0x7FC0;
111 uint16_t infVal = 0x7F80;
121 os << b.
ToFloat32() <<
"(0x" << std::hex << b.
Val() <<
")";
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
BFloat16 & operator=(const BFloat16 &other)=default