TorchLean API

FloatLib.Floats.Formats.Posit.Arithmetic.Limb.Packed.SignedSum.Runtime

Packed two-limb Posit signed sums #

Packed two-limb signed sums align decoded dyadic fields, combine their signed magnitudes, and round within UInt128 whenever the exact intermediate fits that carrier. The sole exact capacity branch is selected by native shift and carry checks; it preserves the same general dyadic semantics for intermediates that genuinely require more than 128 bits.

@[noinline]
def FloatLib.Floats.Formats.Posit.Model.NativeLimbPacked.SignedSum.roundCapacityFieldsWord (format : Format) (heligible : NativeLimb.Eligible format) (leftNegative : Bool) (leftSignificand : Numerics.FixedWord.UInt128) (leftExponent : ) (rightNegative : Bool) (rightSignificand : Numerics.FixedWord.UInt128) (rightExponent : ) :

Exact capacity branch for a signed sum whose aligned magnitude does not fit in two limbs.

Instances For
    @[noinline]
    def FloatLib.Floats.Formats.Posit.Model.NativeLimbPacked.SignedSum.roundAlignedFieldsWord (format : Format) (heligible : NativeLimb.Eligible format) (leftNegative : Bool) (leftSignificand : Numerics.FixedWord.UInt128) (rightNegative : Bool) (rightSignificand : Numerics.FixedWord.UInt128) (exponent : ) :

    Round two nonzero signed magnitudes already aligned at one exponent.

    Instances For
      @[inline]
      def FloatLib.Floats.Formats.Posit.Model.NativeLimbPacked.SignedSum.roundFieldsWord (format : Format) (heligible : NativeLimb.Eligible format) (leftNegative : Bool) (leftSignificand : Numerics.FixedWord.UInt128) (leftExponent : ) (rightNegative : Bool) (rightSignificand : Numerics.FixedWord.UInt128) (rightExponent : ) :

      Round the exact sum of two decoded native dyadics.

      Zero operands bypass alignment. A nonzero operand with the larger exponent is shifted to the smaller exponent when its exact value remains in two limbs. Failed capacity checks enter the one exact wider-intermediate branch.

      Instances For
        @[inline]

        Add two packed Posit words and retain the complete result in two native limbs.

        Instances For
          @[inline]

          Subtract two packed Posit words by reversing the right decoded sign.

          Instances For