Wide-limb storage runtime #
The wide-limb backend serves binary descriptors wider than 128 bits. A stored value is a
LimbArray of exactly limbCount fmt little-endian 32-bit limbs whose bits at and above
fmt.bitWidth are clear; Value fmt packages the array with that invariant, decided by one limb
comparison in topLimbFits. Because the invariant is a Boolean test, the smart constructor
ofLimbs checks a candidate array at runtime. Core.Proof proves that model conversion and field
packing produce arrays that pass this check.
Field access reads the sign bit, the exponent field, and the fraction limbs directly from the
array. pack assembles a result from its sign, exponent word, and fraction limbs with two
carry-free additions at the field offsets. The correspondence with Model is proved in
Core.Proof; every arithmetic kernel of this backend is written over these accessors.
Structural capability required by the wide-limb kernels.
The conventional IEEE encoding selects the exact binary semantics and default bias shared with the
generic kernels. Widths above 128 bits are the formats no fixed-limb kernel serves. An exponent
field of at most 32 bits lets the encoded exponent be read from one 32-bit window. Scale and
position arithmetic uses Nat; the fraction width is unrestricted.
Instances For
Eligibility is decided by an explicit conditional on descriptor fields, exposing those tests to
specialization. See Dispatch.Add.Runtime for the shared dispatch convention.
Number of 32-bit limbs holding one encoded value.
Instances For
Whether the bits at and above bitWidth in the top limb are clear.
Instances For
The all-zero array satisfies the storage invariant.
Wrap a kernel output as a stored value.
An array with the required size and clear spare bits is retained; any other array yields zero.
ofLimbs_val proves the successful case from an explicit size equality and numerical bound.
Instances For
Interpret a stored value in the exact-width proof model.
Instances For
Store a proof-model value as limbs.
Instances For
Field access #
The stored sign bit.
Instances For
Mask of the exponent field within a 32-bit window, for exponent widths of at most 32.
Instances For
The biased exponent field as a machine word.
Instances For
The biased exponent field.
Instances For
The all-ones exponent field as a machine word.
Instances For
The fraction field, in the stored limb count.
Instances For
The significand of a normal value: the fraction with the implicit bit 2^fracWidth.
Instances For
Pack a sign, an exponent word, and fraction limbs into a stored value.
The exponent word is masked to the exponent field and the fraction to fracWidth bits, so the
result is meaningful for every input; Core.Proof.toModel_pack states the exact model produced.