TorchLean API

FloatLib.Floats.ExecFloat.Backends.Generic.ScaleAdd.Runtime

Executable unsigned-scale exact addition #

These kernels align and combine signed magnitudes in an unsigned scale coordinate before entering the product rounder. ScaleAdd.Proof proves agreement with exact dyadic addition and rounding for conventional IEEE descriptors.

@[inline]

Numerics.Dyadic exponent represented by an unsigned scale accepted by FiniteProductRound.round.

The rounder interprets its scale relative to twice the IEEE subnormal alignment offset. The additional roundOffset lets ordinary addition use one-offset coordinates while FMA uses two-offset product coordinates.

Instances For
    @[inline]

    Round one signed magnitude from an unsigned scale.

    Instances For
      @[inline]
      def FloatLib.Floats.Formats.BinaryInterchange.Model.FiniteScaleAdd.roundMagnitudes (fmt : FloatFormat) (roundOffset : ) (leftSign rightSign : Bool) (left right scale : ) :
      Model fmt

      Combine nonzero signed magnitudes at one shared unsigned scale and round once.

      Instances For
        @[inline]
        def FloatLib.Floats.Formats.BinaryInterchange.Model.FiniteScaleAdd.roundSum (fmt : FloatFormat) (roundOffset : ) (leftSign rightSign : Bool) (leftMantissa leftScale rightMantissa rightScale : ) :
        Model fmt

        Align two signed magnitudes in an unsigned scale coordinate and round their exact sum once.

        Instances For