P3109 scaled blocks #
Chapter 5 of the unapproved P3109 interim report 4.0.3 defines a nonempty sequence with one independently typed scale. Decoding multiplies exact closed rational observations, and projection normalizes each exact result before one destination projection. Zero and infinite result scales use the special rules of §5.4.2 rather than ordinary division.
A policy holds one saturation mode and one rounding mode for the whole block. Stochastic modes take one random word per lane, all of the same bit width. Reductions accumulate exact closed values in lane order and round only the final result. The generic elementwise operations cover exact rational closed operations. Transcendental functions need a separate evaluator, which this module does not install.
Reference: §§5.3–5.8 of https://github.com/P3109/Public/tree/34f5964d9bb2382b2665d15467fc3517b990b308.
A nonempty block with independently typed scale and scalar elements.
- scale : Scale
Shared scale, decoded through its own exact source interface.
- values : Vector Element ↑length
Scalar element codes, one per lane.
Instances For
A scalar rounding rule for the whole block, or same-width stochastic words, one per lane.
- scalar {length : ℕ+} (mode : RoundingMode) : BlockRounding length
- stochasticA {length : ℕ+} (width : ℕ) (words : Vector (BitVec width) ↑length) : BlockRounding length
- stochasticB {length : ℕ+} (width : ℕ) (words : Vector (BitVec width) ↑length) : BlockRounding length
- stochasticC {length : ℕ+} (width : ℕ) (words : Vector (BitVec width) ↑length) : BlockRounding length
Instances For
Projection attributes shared by a block, with per-lane random words for stochastic modes.
- rounding : BlockRounding length
Scalar rule or the report's sequence of stochastic random words.
- saturation : SaturationMode
One saturation rule, shared by every element projection.
Instances For
Specialize the shared rounding attributes to one lane as prescribed by §5.3.
Instances For
Exact §5.4.1 decoding, including the closed rules for nonfinite scale or element codes.
Instances For
Closed signum, with zero mapped to zero and either infinity to its sign.
Instances For
Exact §5.4.2 result normalization. NaN takes precedence over zero or infinite scales. A zero scale maps other inputs to zero, and an infinite scale maps them to a signed unit or zero.
Instances For
Normalize exact lane results at the supplied scale, then project each lane once.
Instances For
§5.5.1 conversion out of a block, with independent scalar destination and lane attributes.
Instances For
§5.5.2 conversion to a block whose result scale is given as an operand.
Instances For
Maximum finite absolute value. All-NaN and all-infinite blocks follow closed extrema rules.
Instances For
§5.5.3 select a scale by projecting the maximum finite magnitude, then normalize every lane.
Instances For
Ordered exact closed sum, with a zero identity and no intermediate projections.
Instances For
Ordered exact closed product, with a one identity and no intermediate projections.
Instances For
§5.6.1 sum every decoded lane and project the complete sum once.
Instances For
§5.6.1 multiply every decoded lane and project the complete product once.
Instances For
Exact §5.6.2 dot product of independently scaled blocks, including closed exceptional rules.
Instances For
Project a complete block dot product once, with no rounded lane product or partial sum.
Instances For
§5.7 unary elementwise operation, followed by normalization at a given result scale.
Instances For
§5.7 binary elementwise operation on independent source scales and element formats.
Instances For
§5.7 ternary elementwise operation, retaining the full exact expression until projection.