Skip to content

1.4.0

Choose a tag to compare

@VoidStarKat VoidStarKat released this 13 Oct 04:04

Added

  • Added a bf16 type implementing the alternative bfloat16 16-bit floating point format. By @tspiteri.
  • f16::from_bits, f16::to_bits, f16::is_nan, f16::is_infinite, f16::is_finite, f16::is_sign_positive, and f16::is_sign_negative are now const fns.
  • slice::HalfBitsSliceExt and slice::HalfBitsSliceExt extension traits have been added for performing efficient reinterpret casts and conversions of slices to and from [f16] and [bf16]. These traits will use hardware SIMD conversion instructions when available and the use-intrinsics cargo feature is enabled.
  • vec::HalfBitsVecExt and vec::HalfFloatVecExt extension traits have been added for performing efficient reinterpret casts to and from Vec<f16> and Vec<bf16>. These traits are only available with the std cargo feature.
  • prelude has been added, for easy importing of most common functionality. Currently the prelude imports f16, bf16, and the new slice and vec extension traits.
  • New associated constants on f16 type to replace deprecated consts module.

Fixed

  • Software conversion (when not using use-intrinsics feature) now matches hardware rounding by rounding to nearest, ties to even. Fixes #24, by @tspiteri.
  • NaN value conversions now behave like f32 to f64 conversions, retaining sign. Fixes #23, by @tspiteri.

Changed

  • Minimum rustc version bumped to 1.32.
  • Runtime target host feature detection is now used if both std and use-intrinsics features are enabled and the compile target host does not support required features.
  • When use-intrinsics feature is enabled, will now always compile and run without error correctly regardless of compile target options.

Deprecated

  • consts module and all its constants have been deprecated; use the associated constants on f16 instead.
  • slice::from_bits has been deprecated; use slice::HalfBitsSliceExt::reinterpret_cast instead.
  • slice::from_bits_mut has been deprecated; use slice::HalfBitsSliceExt::reinterpret_cast_mut instead.
  • slice::to_bits has been deprecated; use slice::HalfFloatSliceExt::reinterpret_cast instead.
  • slice::to_bits_mut has been deprecated; use slice::HalfFloatSliceExt::reinterpret_cast_mut instead.
  • vec::from_bits has been deprecated; use vec::HalfBitsVecExt::reinterpret_into instead.
  • vec::to_bits has been deprecated; use vec::HalfFloatVecExt::reinterpret_into instead.