#include <libminifloat.h>
Definition at line 10 of file libminifloat.h.
◆ MiniFloatConverter()
MiniFloatConverter::MiniFloatConverter |
( |
| ) |
|
◆ denorm_min()
static float MiniFloatConverter::denorm_min |
( |
| ) |
|
|
inlinestatic |
◆ filltables()
void MiniFloatConverter::filltables |
( |
| ) |
|
|
staticprivate |
◆ float16to32()
static float MiniFloatConverter::float16to32 |
( |
uint16_t |
h | ) |
|
|
inlinestatic |
Definition at line 13 of file libminifloat.h.
References edm::bit_cast(), exponenttable, h, mantissatable, and offsettable.
Referenced by convertPackedEtaToPackedY(), CompressionElement::unpack(), pat::MET::PackedMETUncertainty::unpack(), pat::PackedGenParticle::unpack(), pat::PackedCandidate::unpack(), BeamCurrentInfo::unpackData(), and pat::PackedCandidate::unpackVtx().
static uint16_t offsettable[64]
To bit_cast(const From &src) noexcept
static uint32_t mantissatable[2048]
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
static uint32_t exponenttable[64]
◆ float32to16()
static uint16_t MiniFloatConverter::float32to16 |
( |
float |
x | ) |
|
|
inlinestatic |
◆ float32to16crop()
static uint16_t MiniFloatConverter::float32to16crop |
( |
float |
x | ) |
|
|
inlinestatic |
Fast implementation, but it crops the number so it biases low.
Definition at line 19 of file libminifloat.h.
References basetable, edm::bit_cast(), shifttable, and x.
21 return basetable[(i32 >> 23) & 0x1ff] + ((i32 & 0x007fffff) >>
shifttable[(i32 >> 23) & 0x1ff]);
To bit_cast(const From &src) noexcept
static uint16_t basetable[512]
static uint8_t shifttable[512]
◆ float32to16round()
static uint16_t MiniFloatConverter::float32to16round |
( |
float |
x | ) |
|
|
inlinestatic |
◆ isdenorm()
static bool MiniFloatConverter::isdenorm |
( |
uint16_t |
h | ) |
|
|
inlinestatic |
Definition at line 124 of file libminifloat.h.
References h.
126 return ((
h >> 10) & 0x1f) == 0 && (
h & 0x3ff) != 0;
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
◆ max()
static float MiniFloatConverter::max |
( |
| ) |
|
|
inlinestatic |
◆ max32RoundedToMax16()
static float MiniFloatConverter::max32RoundedToMax16 |
( |
| ) |
|
|
inlinestatic |
Definition at line 99 of file libminifloat.h.
References edm::bit_cast().
102 constexpr uint32_t i32 = (0x8f << 23) - 1;
To bit_cast(const From &src) noexcept
◆ min()
static float MiniFloatConverter::min |
( |
| ) |
|
|
inlinestatic |
◆ min32RoundedToMin16()
static float MiniFloatConverter::min32RoundedToMin16 |
( |
| ) |
|
|
inlinestatic |
◆ reduceMantissaToNbits() [1/2]
template<int bits>
static float MiniFloatConverter::reduceMantissaToNbits |
( |
const float & |
f | ) |
|
|
inlinestatic |
Definition at line 38 of file libminifloat.h.
References edm::bit_cast(), and f.
Referenced by CompressionElement::pack().
39 static_assert(bits <= 23,
"max mantissa size is 23 bits");
40 constexpr uint32_t mask = (0xFFFFFFFF >> (23 - bits)) << (23 - bits);
To bit_cast(const From &src) noexcept
◆ reduceMantissaToNbits() [2/2]
static float MiniFloatConverter::reduceMantissaToNbits |
( |
const float & |
f, |
|
|
int |
bits |
|
) |
| |
|
inlinestatic |
Definition at line 45 of file libminifloat.h.
References edm::bit_cast(), and f.
46 uint32_t mask = (0xFFFFFFFF >> (23 - bits)) << (23 - bits);
To bit_cast(const From &src) noexcept
◆ reduceMantissaToNbitsRounding() [1/3]
template<int bits>
static float MiniFloatConverter::reduceMantissaToNbitsRounding |
( |
const float & |
f | ) |
|
|
inlinestatic |
◆ reduceMantissaToNbitsRounding() [2/3]
static float MiniFloatConverter::reduceMantissaToNbitsRounding |
( |
float |
f, |
|
|
int |
bits |
|
) |
| |
|
inlinestatic |
Definition at line 84 of file libminifloat.h.
References f.
85 return ReduceMantissaToNbitsRounding(bits)(
f);
◆ reduceMantissaToNbitsRounding() [3/3]
template<typename InItr , typename OutItr >
static void MiniFloatConverter::reduceMantissaToNbitsRounding |
( |
int |
bits, |
|
|
InItr |
begin, |
|
|
InItr |
end, |
|
|
OutItr |
out |
|
) |
| |
|
inlinestatic |
◆ basetable
uint16_t MiniFloatConverter::basetable |
|
staticprivate |
◆ exponenttable
uint32_t MiniFloatConverter::exponenttable |
|
staticprivate |
◆ mantissatable
uint32_t MiniFloatConverter::mantissatable |
|
staticprivate |
◆ offsettable
uint16_t MiniFloatConverter::offsettable |
|
staticprivate |
◆ shifttable
uint8_t MiniFloatConverter::shifttable |
|
staticprivate |