TorchLean API

FloatLib.Floats.ExecFloat.Backends.WideLimb.Addition.Runtime

Wide-limb addition and subtraction runtime #

alignAndRound? combines two signed magnitudes given at unsigned scales, the shared core of addition, subtraction, and fused multiply-add. After ordering the operands by scale it takes one of two routes.

Both routes end in roundNormal?. addNormal? decodes two normal stored values into this core; add and sub use Model.Spec.add and Model.Spec.sub, respectively, for declined cases. Addition.Proof proves that they equal Model.Spec.add and Model.Spec.sub.

Combine two nonzero signed magnitudes whose scales satisfy sb ≤ sa.

The value computed is (aSign, a * 2^sa) + (bSign, b * 2^sb) at unsigned scale sb, rounded by roundNormal? with the given rounding offset. Both magnitudes are expected to be at least 2^fracWidth; Addition.Proof.alignOrdered?_refines states the contract.

Instances For

    Combine two nonzero signed magnitudes at arbitrary unsigned scales.

    Instances For

      Add two normal stored values, negating the second when negateY holds; other cases are declined.

      Instances For

        Wide-limb addition with the reference operation for declined cases.

        Instances For

          Wide-limb subtraction with the reference operation for declined cases.

          Instances For