Skip to content

Releases: starkat99/half-rs

2.4.1

06 Apr 20:07
b2c5209
Compare
Choose a tag to compare

Fixed

  • Missing macro import causing build failure on no_std + alloc feature set. Fixes #107.
  • Clippy warning on nightly rust.

2.4.0

26 Feb 01:10
41cb0f4
Compare
Choose a tag to compare

Added

  • Optional rkyv support. Fixes #100, by @comath.
  • New num-traits implementations: AsPrimitive<f16> for bf16 and AsPrimitive<bf16> for
    f16, allowing lossy conversions between the two types. By @charles-r-earp.
  • Cargo.lock added to vcs as is now recommended for library crates.

Fixed

  • Remove some unit NaN conversion sign tests due to non-deterministic hardware. Fixes #103.
  • Redundant import warnings on nightly Rust.

v1.8.3

26 Feb 01:08
c9a9776
Compare
Choose a tag to compare

Fixed

  • Potential soundness issues resolved.

2.3.1

26 Jun 07:00
cabfc74
Compare
Choose a tag to compare

Fixed

  • Compile error on x86 (not x86_64) targets. Fixes #93.

2.3.0

24 Jun 22:57
837ec03
Compare
Choose a tag to compare

Added

  • Support for Kani Rust Verifier. By @cameron1024.
  • Support for rand_distr::Distribution implementations behind rand_distr optional cargo feature. By @coreylowman.
  • Floating point formatting options in Display and Debug implementations. By @eiz.

Changed

  • Breaking Change Minimum supported Rust version is now 1.70.
  • Breaking Change Minimum supported Rust version policy reverted to original policy of allowing minimum supported Rust version updates for minor releases instead of only major to avoid segmentation and allow optimizing hardware implementations without unnecessary major releases.
  • Hardware intrinsics/assembly is finally available on stable Rust, including using hardware feature detection (std only), including:
    • AArch64 now uses FP16 hardware instructions for conversions and math operations when available.
    • x86/x86-64 now uses F16C hardware instructions for conversions (but no math operations) when available. Fixes #54.

Deprecated

  • use-intrinsics cargo feature no longer used. Hardware support will now always be used whenever possible. A future version may output deprecation warnings if this feature is enabled.

Fixed

  • Improve code generation of leading_zeros functions by inlining. By @encounter.
  • Sum implementation of bf16 incorrectly performed product instead of sum. By @wx-csy.
  • Compile failed when serde cargo feature enabled but std not enabled.
  • Incorrect black boxing of benchmark tests.
  • Rustdoc cfg display on docs.rs not getting enabled.

2.2.1

09 Jan 02:36
4c56dab
Compare
Choose a tag to compare

Changed

  • Reduced unnecessary bounds checks for SIMD operations on slices. By @Shnatsel.
  • Further slice conversion optimizations for slices. Resolves #66.

2.2.0

31 Dec 00:29
08a03fd
Compare
Choose a tag to compare

Added

  • Add serialize_as_f32 and serialize_as_string functions when serde cargo feature is enabled. They allowing customizing the serialization by using #[serde(serialize_with="f16::serialize_as_f32")] attribute in serde derive macros. Closes #60.
  • Deserialize now supports deserializing from f32, f64, and string values in addition to its previous default deserialization. Closes #60.

Changed

  • Add #[inline] on fallback functions, which improved conversion execution on non-nightly rust by up to 50%. By @Shnatsel.

2.1.0

18 Jul 04:55
ebc0b1f
Compare
Choose a tag to compare

Added

  • Add support for target_arch spirv. Some traits and functions are unavailble on this architecture. By @charles-r-earp.
  • Add total_cmp method to both float types. Closes #55, by @joseluis.

2.0.0

21 Jun 06:15
7ae587c
Compare
Choose a tag to compare

Changed

  • Breaking Change Minimum supported Rust version is now 1.58.
  • Breaking Change std is now enabled as a default cargo feature. Disable default features to continue using no_std support.
  • Migrated to Rust Edition 2021.
  • Added #[must_use] attributes to functions, as appropriate.

Fixed

  • Fix a soundness bug with slice::as_ptr not correctly using mutable reference. By @Nilstrieb.

Added

  • Added const conversion methods to both f16 and bf16. These methods never use hardware intrinsics, unlike the current conversion methods, which is why they are separated into new methods. The following const methods were added:
    • from_f32_const
    • from_f64_const
    • to_f32_const
    • to_f64_const
  • Added Neg trait support for borrowed values &f16 and &bf16. By @pthariensflame.
  • Added AsPrimitive implementations from and to self, usize, and isize. By @kali.

Removed

  • Breaking Change The deprecated serialize cargo feature has been removed. Use serde cargo feature instead.
  • Breaking Change The deprecated consts module has been removed. Use associated constants on f16 instead.
  • Breaking Change The following deprecated functions have been removed:
    • f16::as_bits
    • slice::from_bits_mut
    • slice::to_bits_mut
    • slice::from_bits
    • slice::to_bits
    • vec::from_bits
    • vec::to_bits

1.8.2

22 Oct 18:48
9fbefd4
Compare
Choose a tag to compare

Fixed

  • Remove cargo resolver=2 from manifest to resolve errors in older versions of Rust that still worked with 1.8.0. Going forward, MSRV increases will be major version increases. Fixes #48.