Debian Codegraph @

third_party/rust/half/CHANGELOG.md

raw
1 # Changelog
2
3 The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
4 and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
5
6 ## [Unreleased]
7
8
9 ## [2.5.0] - 2024-03-13 <a name="2.5.0"></a>
10 ### Changed
11 - Updated optional dependencies to latest major versions:
12 * `zercopy` 0.6 -> 0.8
13 * `rand` 0.8 -> 0.9
14 * `rand_distr` 0.4 -> 0.5
15 * `rkyv` 0.7 -> 0.8
16 * (dev) `criterion` 0.4 -> 0.5
17 - Minimum supported Rust version has been changed to 1.81 due to above dependency updates.
18 - Minor restructing of included license file locations to be more consistent with crates ecosystem.
19
20 ### Added
21 - Added support for `arbitrary` crate. Fixes [#110]. By [@FL33TW00D].
22 - New `num-traits` implementations: `FromBytes` and `ToBytes` for `f16` and `bf16`. By [@kpreid].
23
24 ### Fixed
25 - Suppressed unexpected_cfg lint warnings on newer versions of stable Rust.
26 - Resolved ambiguous rustdoc warnings due to new unstable `f16` primitive in compiler.
27
28 ## [2.4.1] - 2024-04-06 <a name="2.4.1"></a>
29 ### Fixed
30 - Missing macro import causing build failure on `no_std` + `alloc` feature set. Fixes [#107].
31 - Clippy warning on nightly rust.
32
33 ## [2.4.0] - 2024-02-25 <a name="2.4.0"></a>
34 ### Added
35 - Optional `rkyv` support. Fixes [#100], by [@comath].
36 - New `num-traits` implementations: `AsPrimitive<f16>` for `bf16` and `AsPrimitive<bf16>` for
37 `f16`, allowing lossy conversions between the two types. By [@charles-r-earp].
38 - `Cargo.lock` added to vcs as is now recommended for library crates.
39 ### Fixed
40 - Remove some unit NaN conversion sign tests due to non-deterministic hardware. Fixes [#103].
41 - Redundant import warnings on nightly Rust.
42
43 ## [2.3.1] - 2023-06-24 <a name="2.3.1"></a>
44 ### Fixed
45 - Compile error on x86 (not x86_64) targets. Fixes [#93].
46
47 ## [2.3.0] - 2023-06-24 <a name="2.3.0"></a>
48 ### Added
49 - Support for Kani Rust Verifier. By [@cameron1024].
50 - Support for `rand_distr::Distribution` implementations behind `rand_distr` optional cargo
51 feature. By [@coreylowman].
52 - Floating point formatting options in `Display` and `Debug` implementations. By [@eiz].
53
54 ### Changed
55 - **Breaking Change** Minimum supported Rust version is now 1.70.
56 - **Breaking Change** Minimum supported Rust version policy reverted to original policy of allowing
57 minimum supported Rust version updates for minor releases instead of only major to avoid
58 segmentation and allow optimizing hardware implementations without unnecessary major releases.
59 - Hardware intrinsics/assembly is finally available on stable Rust, including using hardware
60 feature detection (`std` only), including:
61 - AArch64 now uses FP16 hardware instructions for conversions and math operations when
62 available.
63 - x86/x86-64 now uses F16C hardware instructions for conversions (but no math operations) when
64 available. Fixes [#54].
65
66 ### Deprecated
67 - `use-intrinsics` cargo feature no longer used. Hardware support will now always be used whenever
68 possible. A future version may output deprecation warnings if this feature is enabled.
69
70 ### Fixed
71 - Improve code generation of `leading_zeros` functions by inlining. By [@encounter].
72 - `Sum` implementation of `bf16` incorrectly performed product instead of sum. By [@wx-csy].
73 - Compile failed when `serde` cargo feature enabled but `std` not enabled.
74 - Incorrect black boxing of benchmark tests.
75 - Rustdoc cfg display on docs.rs not getting enabled.
76
77 ## [2.2.1] - 2023-01-08 <a name="2.2.1"></a>
78 ### Changed
79 - Reduced unnecessary bounds checks for SIMD operations on slices. By [@Shnatsel].
80 - Further slice conversion optimizations for slices. Resolves [#66].
81
82 ## [2.2.0] - 2022-12-30 <a name="2.2.0"></a>
83 ### Added
84 - Add `serialize_as_f32` and `serialize_as_string` functions when `serde` cargo feature is enabled.
85 They allowing customizing the serialization by using
86 `#[serde(serialize_with="f16::serialize_as_f32")]` attribute in serde derive macros. Closes [#60].
87 - Deserialize now supports deserializing from `f32`, `f64`, and string values in addition to its
88 previous default deserialization. Closes [#60].
89
90 ### Changed
91 - Add `#[inline]` on fallback functions, which improved conversion execution on non-nightly rust
92 by up to 50%. By [@Shnatsel].
93
94 ## [2.1.0] - 2022-07-18 <a name="2.1.0"></a>
95 ### Added
96 - Add support for target_arch `spirv`. Some traits and functions are unavailble on this
97 architecture. By [@charles-r-earp].
98 - Add `total_cmp` method to both float types. Closes [#55], by [@joseluis].
99
100 ## [2.0.0] - 2022-06-21 <a name="2.0.0"></a>
101 ### Changed
102 - **Breaking Change** Minimum supported Rust version is now 1.58.
103 - **Breaking Change** `std` is now enabled as a default cargo feature. Disable default features to
104 continue using `no_std` support.
105 - Migrated to Rust Edition 2021.
106 - Added `#[must_use]` attributes to functions, as appropriate.
107
108 ### Fixed
109 - Fix a soundness bug with `slice::as_ptr` not correctly using mutable reference. By [@Nilstrieb].
110
111 ### Added
112 - Added `const` conversion methods to both `f16` and `bf16`. These methods never use hardware
113 intrinsics, unlike the current conversion methods, which is why they are separated into new
114 methods. The following `const` methods were added:
115 - `from_f32_const`
116 - `from_f64_const`
117 - `to_f32_const`
118 - `to_f64_const`
119 - Added `Neg` trait support for borrowed values `&f16` and `&bf16`. By [@pthariensflame].
120 - Added `AsPrimitive` implementations from and to self, `usize`, and `isize`. By [@kali].
121
122 ### Removed
123 - **Breaking Change** The deprecated `serialize` cargo feature has been removed. Use `serde` cargo
124 feature instead.
125 - **Breaking Change** The deprecated `consts` module has been removed. Use associated constants on
126 `f16` instead.
127 - **Breaking Change** The following deprecated functions have been removed:
128 - `f16::as_bits`
129 - `slice::from_bits_mut`
130 - `slice::to_bits_mut`
131 - `slice::from_bits`
132 - `slice::to_bits`
133 - `vec::from_bits`
134 - `vec::to_bits`
135
136 ## [1.8.2] - 2021-10-22 <a name="1.8.2"></a>
137 ### Fixed
138 - Remove cargo resolver=2 from manifest to resolve errors in older versions of Rust that still
139 worked with 1.8.0. Going forward, MSRV increases will be major version increases. Fixes [#48].
140
141 ## [1.8.1] - 2021-10-21 - **Yanked** <a name="1.8.1"></a>
142 ### ***Yanked***
143 *Not recommended due to introducing compilation error in Rust versions that worked with 1.8.0.*
144 ### Changed
145 - Now uses cargo resolver version 2 to prevent dev-dependencies from enabling `std` feature on
146 optional dependencies.
147
148 ### Fixed
149 - Fixed compile failure when `std` feature is not enabled and `num-traits` is enabled under new
150 resolver. Now properly uses `libm` num-traits feature.
151
152 ## [1.8.0] - 2021-10-13 <a name="1.8.0"></a>
153 ### Changed
154 - Now always implements `Add`, `Div`, `Mul`, `Neg`, `Rem`, and `Sub` traits.
155 Previously, these were only implemented under the `num-traits` feature. Keep in mind they still
156 convert to `f32` and back in the implementation.
157 - Minimum supported Rust version is now 1.51.
158 - Made crate package [REUSE compliant](https://reuse.software/).
159 - Docs now use intra-doc links instead of manual (and hard to maintain) links.
160 - The following methods on both `f16` and `bf16` are now `const`:
161 - `to_le_bytes`
162 - `to_be_bytes`
163 - `to_ne_bytes`
164 - `from_le_bytes`
165 - `from_be_bytes`
166 - `from_ne_bytes`
167 - `is_normal`
168 - `classify`
169 - `signum`
170
171 ### Added
172 - Added optional implementations of `zerocopy` traits `AsBytes` and `FromBytes`
173 under `zerocopy` cargo feature. By [@samcrow].
174 - Implemented the `core::iter::Product` and `core::iter::Sum` traits, with the same caveat as above
175 about converting to `f32` and back under the hood.
176 - Added new associated const `NEG_ONE` to both `f16` and `bf16`.
177 - Added the following new methods on both `f16` and `bf16`:
178 - `copysign`
179 - `max`
180 - `min`
181 - `clamp`
182
183 ### Fixed
184 - Fixed a number of minor lints discovered due to improved CI.
185
186 ## [1.7.1] - 2021-01-17 <a name="1.7.1"></a>
187 ### Fixed
188 - Docs.rs now generates docs for `bytemuck` and `num-traits` optional features.
189
190 ## [1.7.0] - 2021-01-17 <a name="1.7.0"></a>
191 ### Added
192 - Added optional implementations of `bytemuck` traits `Zeroable` and `Pod` under `bytemuck` cargo
193 feature. By [@charles-r-earp].
194 - Added optional implementations of `num-traits` traits `ToPrimitive` and `FromPrimitive` under
195 `num-traits` cargo feature. By [@charles-r-earp].
196 - Added implementations of `Binary`, `Octal`, `LowerHex`, and `UpperHex` string format traits to
197 format raw `f16`/`bf16` bytes to string.
198
199 ### Changed
200 - `Debug` trait implementation now formats `f16`/`bf16` as float instead of raw bytes hex. Use newly
201 implemented formatting traits to format in hex instead of `Debug`. Fixes [#37].
202
203
204 ## [1.6.0] - 2020-05-09 <a name="1.6.0"></a>
205 ### Added
206 - Added `LOG2_10` and `LOG10_2` constants to both `f16` and `bf16`, which were added to `f32` and
207 `f64` in the standard library in 1.43.0. By [@tspiteri].
208 - Added `to_le/be/ne_bytes` and `from_le/be/ne_bytes` to both `f16` and `bf16`, which were added to
209 the standard library in 1.40.0. By [@bzm3r].
210
211 ## [1.5.0] - 2020-03-03 <a name="1.5.0"></a>
212 ### Added
213 - Added the `alloc` feature to support the `alloc` crate in `no_std` environments. By [@zserik]. The
214 `vec` module is now available with either `alloc` or `std` feature.
215
216 ## [1.4.1] - 2020-02-10 <a name="1.4.1"></a>
217 ### Fixed
218 - Added `#[repr(transparent)]` to `f16`/`bf16` to remove undefined behavior. By [@jfrimmel].
219
220 ## [1.4.0] - 2019-10-13 <a name="1.4.0"></a>
221 ### Added
222 - Added a `bf16` type implementing the alternative
223 [`bfloat16`](https://en.wikipedia.org/wiki/Bfloat16_floating-point_format) 16-bit floating point
224 format. By [@tspiteri].
225 - `f16::from_bits`, `f16::to_bits`, `f16::is_nan`, `f16::is_infinite`, `f16::is_finite`,
226 `f16::is_sign_positive`, and `f16::is_sign_negative` are now `const` fns.
227 - `slice::HalfBitsSliceExt` and `slice::HalfBitsSliceExt` extension traits have been added for
228 performing efficient reinterpret casts and conversions of slices to and from `[f16]` and
229 `[bf16]`. These traits will use hardware SIMD conversion instructions when available and the
230 `use-intrinsics` cargo feature is enabled.
231 - `vec::HalfBitsVecExt` and `vec::HalfFloatVecExt` extension traits have been added for
232 performing efficient reinterpret casts to and from `Vec<f16>` and `Vec<bf16>`. These traits
233 are only available with the `std` cargo feature.
234 - `prelude` has been added, for easy importing of most common functionality. Currently the
235 prelude imports `f16`, `bf16`, and the new slice and vec extension traits.
236 - New associated constants on `f16` type to replace deprecated `consts` module.
237
238 ### Fixed
239 - Software conversion (when not using `use-intrinsics` feature) now matches hardware rounding
240 by rounding to nearest, ties to even. Fixes [#24], by [@tspiteri].
241 - NaN value conversions now behave like `f32` to `f64` conversions, retaining sign. Fixes [#23],
242 by [@tspiteri].
243
244 ### Changed
245 - Minimum rustc version bumped to 1.32.
246 - Runtime target host feature detection is now used if both `std` and `use-intrinsics` features are
247 enabled and the compile target host does not support required features.
248 - When `use-intrinsics` feature is enabled, will now always compile and run without error correctly
249 regardless of compile target options.
250
251 ### Deprecated
252 - `consts` module and all its constants have been deprecated; use the associated constants on `f16`
253 instead.
254 - `slice::from_bits` has been deprecated; use `slice::HalfBitsSliceExt::reinterpret_cast` instead.
255 - `slice::from_bits_mut` has been deprecated; use `slice::HalfBitsSliceExt::reinterpret_cast_mut`
256 instead.
257 - `slice::to_bits` has been deprecated; use `slice::HalfFloatSliceExt::reinterpret_cast` instead.
258 - `slice::to_bits_mut` has been deprecated; use `slice::HalfFloatSliceExt::reinterpret_cast_mut`
259 instead.
260 - `vec::from_bits` has been deprecated; use `vec::HalfBitsVecExt::reinterpret_into` instead.
261 - `vec::to_bits` has been deprecated; use `vec::HalfFloatVecExt::reinterpret_into` instead.
262
263 ## [1.3.1] - 2019-10-04 <a name="1.3.1"></a>
264 ### Fixed
265 - Corrected values of constants `EPSILON`, `MAX_10_EXP`, `MAX_EXP`, `MIN_10_EXP`, and `MIN_EXP`
266 in `consts` module, as well as setting `consts::NAN` to match value of `f32::NAN` converted to
267 `f16`. By [@tspiteri].
268
269 ## [1.3.0] - 2018-10-02 <a name="1.3.0"></a>
270 ### Added
271 - `slice::from_bits_mut` and `slice::to_bits_mut` for conversion between mutable `u16` and `f16`
272 slices. Fixes [#16], by [@johannesvollmer].
273
274 ## [1.2.0] - 2018-09-03 <a name="1.2.0"></a>
275 ### Added
276 - `slice` and optional `vec` (only included with `std` feature) modules for conversions between
277 `u16` and `f16` buffers. Fixes [#14], by [@johannesvollmer].
278 - `to_bits` added to replace `as_bits`. Fixes [#12], by [@tspiteri].
279 ### Fixed
280 - `serde` optional dependency no longer uses its default `std` feature.
281 ### Deprecated
282 - `as_bits` has been deprecated; use `to_bits` instead.
283 - `serialize` cargo feature is deprecated; use `serde` instead.
284
285 ## [1.1.2] - 2018-07-12 <a name="1.1.2"></a>
286 ### Fixed
287 - Fixed compilation error in 1.1.1 on rustc < 1.27, now compiles again on rustc >= 1.10. Fixes
288 [#11].
289
290 ## [1.1.1] - 2018-06-24 - **Yanked** <a name="1.1.1"></a>
291 ### ***Yanked***
292 *Not recommended due to introducing compilation error on rustc versions prior to 1.27.*
293 ### Fixed
294 - Fix subnormal float conversions when `use-intrinsics` is not enabled. By [@Moongoodboy-K].
295
296 ## [1.1.0] - 2018-03-17 <a name="1.1.0"></a>
297 ### Added
298 - Made `to_f32` and `to_f64` public. Fixes [#7], by [@PSeitz].
299
300 ## [1.0.2] - 2018-01-12 <a name="1.0.2"></a>
301 ### Changed
302 - Update behavior of `is_sign_positive` and `is_sign_negative` to match the IEEE754 conforming
303 behavior of the standard library since Rust 1.20.0. Fixes [#3], by [@tspiteri].
304 - Small optimization on `is_nan` and `is_infinite` from [@tspiteri].
305 ### Fixed
306 - Fix comparisons of +0 to -0 and comparisons involving negative numbers. Fixes [#2], by
307 [@tspiteri].
308 - Fix loss of sign when converting `f16` and `f32` to `f16`, and case where `f64` NaN could be
309 converted to `f16` infinity instead of NaN. Fixes [#5], by [@tspiteri].
310
311 ## [1.0.1] - 2017-08-30 <a name="1.0.1"></a>
312 ### Added
313 - More README documentation.
314 - Badges and categories in crate metadata.
315 ### Changed
316 - `serde` dependency updated to 1.0 stable.
317 - Writing changelog manually.
318
319 ## [1.0.0] - 2017-02-03 <a name="1.0.0"></a>
320 ### Added
321 - Update to `serde` 0.9 and stable Rust 1.15 for `serialize` feature.
322
323 ## [0.1.1] - 2017-01-08 <a name="0.1.1"></a>
324 ### Added
325 - Add `serde` support under new `serialize` feature.
326 ### Changed
327 - Use `no_std` for crate by default.
328
329 ## 0.1.0 - 2016-03-17 <a name="0.1.0"></a>
330 ### Added
331 - Initial release of `f16` type.
332
333 [#2]: https://github.com/starkat99/half-rs/issues/2
334 [#3]: https://github.com/starkat99/half-rs/issues/3
335 [#5]: https://github.com/starkat99/half-rs/issues/5
336 [#7]: https://github.com/starkat99/half-rs/issues/7
337 [#11]: https://github.com/starkat99/half-rs/issues/11
338 [#12]: https://github.com/starkat99/half-rs/issues/12
339 [#14]: https://github.com/starkat99/half-rs/issues/14
340 [#16]: https://github.com/starkat99/half-rs/issues/16
341 [#23]: https://github.com/starkat99/half-rs/issues/23
342 [#24]: https://github.com/starkat99/half-rs/issues/24
343 [#37]: https://github.com/starkat99/half-rs/issues/37
344 [#48]: https://github.com/starkat99/half-rs/issues/48
345 [#55]: https://github.com/starkat99/half-rs/issues/55
346 [#60]: https://github.com/starkat99/half-rs/issues/60
347 [#66]: https://github.com/starkat99/half-rs/issues/66
348 [#54]: https://github.com/starkat99/half-rs/issues/54
349 [#93]: https://github.com/starkat99/half-rs/issues/54
350 [#100]: https://github.com/starkat99/half-rs/issues/100
351 [#103]: https://github.com/starkat99/half-rs/issues/103
352 [#107]: https://github.com/starkat99/half-rs/issues/107
353 [#110]: https://github.com/starkat99/half-rs/issues/110
354
355 [@tspiteri]: https://github.com/tspiteri
356 [@PSeitz]: https://github.com/PSeitz
357 [@Moongoodboy-K]: https://github.com/Moongoodboy-K
358 [@johannesvollmer]: https://github.com/johannesvollmer
359 [@jfrimmel]: https://github.com/jfrimmel
360 [@zserik]: https://github.com/zserik
361 [@bzm3r]: https://github.com/bzm3r
362 [@charles-r-earp]: https://github.com/charles-r-earp
363 [@samcrow]: https://github.com/samcrow
364 [@pthariensflame]: https://github.com/pthariensflame
365 [@kali]: https://github.com/kali
366 [@Nilstrieb]: https://github.com/Nilstrieb
367 [@joseluis]: https://github.com/joseluis
368 [@Shnatsel]: https://github.com/Shnatsel
369 [@cameron1024]: https://github.com/cameron1024
370 [@encounter]: https://github.com/encounter
371 [@coreylowman]: https://github.com/coreylowman
372 [@wx-csy]: https://github.com/wx-csy
373 [@eiz]: https://github.com/eiz
374 [@comath]: https://github.com/comath
375 [@FL33TW00D]: https://github.com/FL33TW00D
376 [@kpreid]: https://github.com/kpreid
377
378
379 [Unreleased]: https://github.com/starkat99/half-rs/compare/v2.5.0...HEAD
380 [2.5.0]: https://github.com/starkat99/half-rs/compare/v2.4.1...v2.5.0
381 [2.4.1]: https://github.com/starkat99/half-rs/compare/v2.4.0...v2.4.1
382 [2.4.0]: https://github.com/starkat99/half-rs/compare/v2.3.1...v2.4.0
383 [2.3.1]: https://github.com/starkat99/half-rs/compare/v2.3.0...v2.3.1
384 [2.3.0]: https://github.com/starkat99/half-rs/compare/v2.2.1...v2.3.0
385 [2.2.1]: https://github.com/starkat99/half-rs/compare/v2.2.0...v2.2.1
386 [2.2.0]: https://github.com/starkat99/half-rs/compare/v2.1.0...v2.2.0
387 [2.1.0]: https://github.com/starkat99/half-rs/compare/v2.0.0...v2.1.0
388 [2.0.0]: https://github.com/starkat99/half-rs/compare/v1.8.2...v2.0.0
389 [1.8.2]: https://github.com/starkat99/half-rs/compare/v1.8.1...v1.8.2
390 [1.8.1]: https://github.com/starkat99/half-rs/compare/v1.8.0...v1.8.1
391 [1.8.0]: https://github.com/starkat99/half-rs/compare/v1.7.1...v1.8.0
392 [1.7.1]: https://github.com/starkat99/half-rs/compare/v1.7.0...v1.7.1
393 [1.7.0]: https://github.com/starkat99/half-rs/compare/v1.6.0...v1.7.0
394 [1.6.0]: https://github.com/starkat99/half-rs/compare/v1.5.0...v1.6.0
395 [1.5.0]: https://github.com/starkat99/half-rs/compare/v1.4.1...v1.5.0
396 [1.4.1]: https://github.com/starkat99/half-rs/compare/v1.4.0...v1.4.1
397 [1.4.0]: https://github.com/starkat99/half-rs/compare/v1.3.1...v1.4.0
398 [1.3.1]: https://github.com/starkat99/half-rs/compare/v1.3.0...v1.3.1
399 [1.3.0]: https://github.com/starkat99/half-rs/compare/v1.2.0...v1.3.0
400 [1.2.0]: https://github.com/starkat99/half-rs/compare/v1.1.2...v1.2.0
401 [1.1.2]: https://github.com/starkat99/half-rs/compare/v1.1.1...v1.1.2
402 [1.1.1]: https://github.com/starkat99/half-rs/compare/v1.1.0...v1.1.1
403 [1.1.0]: https://github.com/starkat99/half-rs/compare/v1.0.2...v1.1.0
404 [1.0.2]: https://github.com/starkat99/half-rs/compare/v1.0.1...v1.0.2
405 [1.0.1]: https://github.com/starkat99/half-rs/compare/v1.0.0...v1.0.1
406 [1.0.0]: https://github.com/starkat99/half-rs/compare/v0.1.1...v1.0.0
407 [0.1.1]: https://github.com/starkat99/half-rs/compare/v0.1.0...v0.1.1