15 return edm::bit_cast<
float>(i32);
20 uint32_t i32 = edm::bit_cast<uint32_t>(
x);
21 return basetable[(i32 >> 23) & 0x1ff] + ((i32 & 0x007fffff) >>
shifttable[(i32 >> 23) & 0x1ff]);
25 uint32_t i32 = edm::bit_cast<uint32_t>(
x);
28 uint16_t
base2 = (i32 & 0x007fffff) >> 12;
34 return basetable[(i32 >> 23) & 0x1ff] + ((i32 & 0x007fffff) >>
shifttable[(i32 >> 23) & 0x1ff]);
39 static_assert(
bits <= 23,
"max mantissa size is 23 bits");
41 uint32_t i32 = edm::bit_cast<uint32_t>(
f);
43 return edm::bit_cast<
float>(i32);
46 uint32_t
mask = (0xFFFFFFFF >> (23 -
bits)) << (23 -
bits);
47 uint32_t i32 = edm::bit_cast<uint32_t>(
f);
49 return edm::bit_cast<
float>(i32);
61 uint32_t i32 = edm::bit_cast<uint32_t>(
f);
63 uint32_t mantissa = (i32 & low23) >>
shift;
66 i32 = (i32 & hi9) | (mantissa <<
shift);
70 return edm::bit_cast<
float>(i32);
88 template <
typename InItr,
typename OutItr>
93 inline static float max() {
95 return edm::bit_cast<
float>(i32);
102 constexpr uint32_t i32 = (0x8f << 23) - 1;
103 return edm::bit_cast<
float>(i32);
106 inline static float min() {
108 return edm::bit_cast<
float>(i32);
116 return edm::bit_cast<
float>(i32);
121 return edm::bit_cast<
float>(i32);
126 return ((
h >> 10) & 0x1f) == 0 && (
h & 0x3ff) != 0;
static uint16_t float32to16crop(float x)
Fast implementation, but it crops the number so it biases low.
static float min32RoundedToMin16()
static uint16_t offsettable[64]
static float float16to32(uint16_t h)
static uint16_t basetable[512]
static float denorm_min()
static uint8_t shifttable[512]
static uint16_t float32to16(float x)
static uint32_t mantissatable[2048]
static float reduceMantissaToNbits(const float &f, int bits)
static float reduceMantissaToNbitsRounding(float f, int bits)
static bool isdenorm(uint16_t h)
ReduceMantissaToNbitsRounding(int bits)
static float reduceMantissaToNbitsRounding(const float &f)
static float max32RoundedToMax16()
static unsigned int const shift
float operator()(float f) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
static uint16_t float32to16round(float x)
Slower implementation, but it rounds to avoid biases.
static float reduceMantissaToNbits(const float &f)
static uint32_t exponenttable[64]
static void reduceMantissaToNbitsRounding(int bits, InItr begin, InItr end, OutItr out)