Direct one-word guard-and-sticky Posit rounding #
The shared field-oriented posit rounder is instantiated with the UInt64 carrier.
candidateCarrier maps every shared operation to a native-word primitive, and the generic
kernel in GuardStickyCarrier keeps the candidate code in UInt64 during packing and rounding.
Only steps with carrier-specific contracts live here: the exact minimum-positive comparison, the
zero test, and sign restoration.
Intermediate capacity selects the kernel, and no named Posit width is special. Operations that
continue in a two-limb intermediate import the WordLimb adapter at that boundary, so this scalar
rounder neither depends on nor re-exports a second implementation.
Shift left in the one-word bitstream, returning zero at and beyond 64 positions.
Instances For
Whether the discarded low-bit suffix is nonzero.
Instances For
Parity of the packed candidate used to break a midpoint tie.
Instances For
One-word implementation of the shared candidate carrier.
This transparent record is consumed only by always-inlined helpers, leaving the generated hot path
in primitive UInt64 operations. Shifts return zero at and beyond the word width, where the
native shift would reduce the amount modulo 64. Addition and the successor are the wrapping machine
operations, which the shared rounder applies only to values it has bounded.
Instances For
Test a positive scalar target against the format's exact minimum-positive value, a power of two, by comparing the exponent of its leading bit.
Instances For
Round the nonnegative value significand * 2 ^ exponent to its complete unsigned code in one word.
Zero maps to code zero and targets below minPos to code one. Every other target uses the shared
normalized rounder at the UInt64 carrier.
Instances For
Natural-number view of positive native-field rounding.
Instances For
Round signed native dyadic fields and retain the complete code in one word.
Instances For
Natural-number view of complete signed native-field rounding.