TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Format.Runtime

Compiled binary format constants #

Layout proofs are easiest to read with powers such as 2 ^ fmt.expWidth, but compiled code is better served by left shifts. Frequently used format values therefore have shift-based implementations, with proved equalities registered for compiler substitution.

Theorems use the mathematical definitions, and compiled code runs the proved shift formulas.

@[inline]

Shift-based compiled implementation of bias.

Instances For
    @[inline]

    Shift-based compiled implementation of expAllOnesNat.

    Instances For
      @[inline]

      Shift-based compiled implementation of fracMaskNat.

      Instances For
        @[inline]

        Shift-based compiled implementation of expMaskNat.

        Instances For
          @[inline]

          Shift-based compiled implementation of signMaskNat.

          Instances For
            @[inline]

            Shift-based compiled implementation of quietBitNat.

            Instances For
              @[csimp]

              Compiler substitution of exponent-bias exponentiation by the equivalent shift kernel.

              @[csimp]

              Compiler substitution of the all-ones exponent mask by the equivalent shift kernel.

              @[csimp]

              Compiler substitution of the fraction mask by the equivalent shift kernel.

              @[csimp]

              Compiler substitution of the shifted exponent mask by the equivalent shift kernel.

              @[csimp]

              Compiler substitution of the sign mask by the equivalent shift kernel.

              @[csimp]

              Compiler substitution of the quiet-NaN bit by the equivalent shift kernel.