TorchLean API

FloatLib.Floats.ExecFloat.Backends.FixedLimb.Pair.Fma.Runtime

Two-word fused multiply-add runtime #

Normal inputs whose product and addend have the same sign and the supported alignment use a four-word exact sum and one nearest-even rounding step. The complete finite candidate chain then uses the width-generic exact kernel for other finite inputs. Correctness proofs live in Fma.Proof.

@[inline]

Shift a normal significand by fracWidth bits into the product's four-word coordinate.

Instances For
    @[inline]

    Try the all-native same-sign, exactly aligned normal FMA path.

    The sign test uses the public carrier's most-significant bit before native-word decoding, keeping declined opposite-sign cases cheap. The addend is accepted when its scale equals the product scale plus fracWidth, so both operands share the four-word coordinate of the product rounder.

    Instances For
      @[specialize #[0]]

      Evaluate finite two-word fused multiply-add.

      The aligned fixed-limb kernel is attempted first. Every remaining finite case uses the generic one-rounding exact kernel; exceptional inputs are reported as none to the dispatcher. Descriptor specialization follows the pattern described in Dispatch.Add.Runtime.

      Instances For