Exact-width binary format storage #
Exact-width BitVec representations of layout masks derived from a validated FloatFormat.
The definitions centralize sign, exponent, significand, and payload masks so packing code does not
reconstruct them with ad hoc shifts. They describe logical layout only; selection of UInt8,
UInt16, UInt32, UInt64, or arbitrary-width storage belongs to the configured execution layer.
@[inline]
def
FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.ofWordNat
(fmt : FloatFormat)
(n : Nat)
:
fmt.ExecWord
Pack a Nat pattern into the format's exact-width storage word.
Instances For
@[inline]
def
FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.expAllOnes
(fmt : FloatFormat)
:
fmt.ExecWord
Exponent all-ones as storage word.
Instances For
@[inline]
def
FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.fracMask
(fmt : FloatFormat)
:
fmt.ExecWord
Fraction mask as storage word.
Instances For
@[inline]
Shifted exponent mask as storage word.
Instances For
@[inline]
def
FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.signMask
(fmt : FloatFormat)
:
fmt.ExecWord
Sign-bit mask as storage word.
Instances For
@[simp]
The exact-width sign mask decodes to its unique top-bit power of two.
@[simp]
theorem
FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.signMask_ne_zero
(fmt : FloatFormat)
:
The sign-bit mask is nonzero for every valid format descriptor.
@[inline]
def
FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.quietBit
(fmt : FloatFormat)
:
fmt.ExecWord
Quiet-NaN bit as storage word.