Creates a packed float from a sign, an exponent and a mantissa.
Equations
- Float.Model.UnpackedFloat.packComponents spec sign exponent mantissa = sign.toBitVec ++ exponent ++ mantissa
Instances For
Creates the packed signed infinity representation for the given specification.
Equations
- Float.Model.UnpackedFloat.packedInfinity spec sign = Float.Model.UnpackedFloat.packComponents spec sign (-1#spec.exponentBits) 0
Instances For
Creates the canonical packed NaN for the given specification.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Creates the packed signed zero representation for the given specification.
Equations
- Float.Model.UnpackedFloat.packedZero spec sign = Float.Model.UnpackedFloat.packComponents spec sign 0 0
Instances For
Packs the given float into the format given by the specification.
This function assumes that the float is already correctly rounded for the given specification.
This means that the exponent must be equal to the exponent computed by spec.targetExponent.
Equations
- One or more equations did not get rendered due to their size.
- Float.Model.UnpackedFloat.pack spec Float.Model.UnpackedFloat.notANumber = Float.Model.UnpackedFloat.packedNaN spec
- Float.Model.UnpackedFloat.pack spec (Float.Model.UnpackedFloat.infinity s) = Float.Model.UnpackedFloat.packedInfinity spec s
- Float.Model.UnpackedFloat.pack spec (Float.Model.UnpackedFloat.zero s) = Float.Model.UnpackedFloat.packedZero spec s
Instances For
Unpacks the mantissa portion of the packed float. If this is a normal number, this will be missing the implicit bit.
Equations
Instances For
Unpacks the exponent portion of the packed float.
Equations
- Float.Model.UnpackedFloat.unpackExponent b = BitVec.cast ⋯ (BitVec.extractLsb (spec.mantissaBitsWithoutImplicit + spec.exponentBits - 1) spec.mantissaBitsWithoutImplicit b)
Instances For
Unpacks the sign bit of the packed float.
Equations
- Float.Model.UnpackedFloat.unpackSign b = BitVec.cast ⋯ (BitVec.extractLsb (spec.mantissaBitsWithoutImplicit + spec.exponentBits) (spec.mantissaBitsWithoutImplicit + spec.exponentBits) b)
Instances For
Unpacks the given float according to the given specification.
The resulting float may be assumed to be correctly rounded for the given specification.
Equations
- One or more equations did not get rendered due to their size.