Releases: starkat99/half-rs
Releases · starkat99/half-rs
2.4.1
2.4.0
Added
- Optional
rkyv
support. Fixes #100, by @comath. - New
num-traits
implementations:AsPrimitive<f16>
forbf16
andAsPrimitive<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
2.3.1
2.3.0
Added
- Support for Kani Rust Verifier. By @cameron1024.
- Support for
rand_distr::Distribution
implementations behindrand_distr
optional cargo feature. By @coreylowman. - Floating point formatting options in
Display
andDebug
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 ofbf16
incorrectly performed product instead of sum. By @wx-csy.- Compile failed when
serde
cargo feature enabled butstd
not enabled. - Incorrect black boxing of benchmark tests.
- Rustdoc cfg display on docs.rs not getting enabled.
2.2.1
2.2.0
Added
- Add
serialize_as_f32
andserialize_as_string
functions whenserde
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
2.0.0
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 usingno_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 bothf16
andbf16
. These methods never use hardware intrinsics, unlike the current conversion methods, which is why they are separated into new methods. The followingconst
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
, andisize
. By @kali.
Removed
- Breaking Change The deprecated
serialize
cargo feature has been removed. Useserde
cargo feature instead. - Breaking Change The deprecated
consts
module has been removed. Use associated constants onf16
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