| 1 |
# 0.4.2 |
| 2 |
|
| 3 |
* Refactor detection of the DIT feature on ARM. For builds without the |
| 4 |
"std" feature, there's now an undocumented function to force the use |
| 5 |
of the DIT bit. |
| 6 |
|
| 7 |
# 0.4.1 |
| 8 |
|
| 9 |
* Simplify code to make it easier to review. |
| 10 |
|
| 11 |
# 0.4.0 |
| 12 |
|
| 13 |
BREAKING CHANGE: this crate now has a "std" feature which is enabled by |
| 14 |
default. Disable it if you need to use this crate as a no_std crate. |
| 15 |
|
| 16 |
Previous versions of this crate protected against the optimizer doing an |
| 17 |
early exit when the accumulator becomes non-zero (found a difference), |
| 18 |
but not against a sufficiently smart optimizer doing an early exit when |
| 19 |
the accumulator has all bits set (the accumulator never clears a bit, so |
| 20 |
having all bits set means it will no longer change). |
| 21 |
|
| 22 |
Protecting against that also prevents autovectorization, so this release |
| 23 |
does manual vectorization to recover most of the speed lost. Where there |
| 24 |
is enough compiler support (stable vector intrinsics), it uses a mix of |
| 25 |
vector intrinsics and inline assembly for inputs which are a multiple of |
| 26 |
the vector size, while for other architectures and for the remainder of |
| 27 |
an input which is not a multiple of the vector size, it uses a generic |
| 28 |
word-at-a-time implementation with the native word size. |
| 29 |
|
| 30 |
Some newer implementations of the ARM architecture do not guarantee the |
| 31 |
timing of instructions unless the DIT bit is set. Fortunately, that bit |
| 32 |
can be set on all privilege levels; unfortunately, that bit only exists |
| 33 |
on these newer implementations of the ARM architecture, and the flag to |
| 34 |
detect whether it exists is not accessible on all privilege levels. How |
| 35 |
to obtain that flag varies depending on the operating system, but Rust |
| 36 |
has a good implementation of that on its standard library. This means |
| 37 |
that runtime detection introduces a dependency on std (enabled by the |
| 38 |
"std" feature, which is enabled by default); compile-time detection is |
| 39 |
always available. |
| 40 |
|
| 41 |
This release is a candidate for becoming the 1.0 release. In preparation |
| 42 |
for that, it uses the 2024 edition, which enables the new resolver which |
| 43 |
will allow future updates to the set of architectures which can use the |
| 44 |
inline assembly implementation of optimizer_hide(), without breaking |
| 45 |
downstream crates (for instance, s390x and arm64ec were stabilized in |
| 46 |
Rust 1.84.0). |
| 47 |
|
| 48 |
* Rewrite the generic implementation to process one word at a time, |
| 49 |
instead of byte by byte. Depending on the architecture, this means |
| 50 |
8 bytes or 4 bytes processed on each loop iteration. |
| 51 |
* Use optimizer_hide() after each step, instead of just at the end. |
| 52 |
* Since optimizer_hide() now works on words, it no longer neeeds the |
| 53 |
special case for byte sub-registers on x86 and x86_64. |
| 54 |
* Manual implementation for SSE2/AVX (x86 and x86_64), using 128-bit |
| 55 |
vectors, processing up to 32 bytes on each loop iteration. |
| 56 |
* Manual implementation for NEON (aarch64 only for now), also using |
| 57 |
128-bit vectors and processing up to 32 bytes on each loop iteration. |
| 58 |
* On AArch64 with FEAT_DIT (like modern Apple devices), try to set the |
| 59 |
DIT flag to ensure data independent timing. |
| 60 |
|
| 61 |
# 0.3.1 |
| 62 |
|
| 63 |
* Use the portable optimizer_hide() when running under Miri. |
| 64 |
|
| 65 |
# 0.3.0 |
| 66 |
|
| 67 |
* Use black_box instead of volatile read when inline assembly is not |
| 68 |
available. |
| 69 |
* Increase minimum Rust version to 1.66, which is when black_box was |
| 70 |
stabilized. |
| 71 |
|
| 72 |
# 0.2.6 |
| 73 |
|
| 74 |
* New tests using the count_instructions crate; no functional changes. |
| 75 |
|
| 76 |
# 0.2.5 |
| 77 |
|
| 78 |
* Add #[must_use] to all functions. |
| 79 |
|
| 80 |
# 0.2.4 |
| 81 |
|
| 82 |
* Since CC0 is no longer accepted as a license for code by Fedora, also |
| 83 |
allow MIT-0 or Apache-2.0 as options. No code changes. |
| 84 |
|
| 85 |
# 0.2.3 |
| 86 |
|
| 87 |
* Add fixed-size variant for arrays of any size (using const generics). |
| 88 |
|
| 89 |
# 0.2.2 |
| 90 |
|
| 91 |
* Set rust-version in Cargo.toml to 1.59. |
| 92 |
|
| 93 |
# 0.2.1 |
| 94 |
|
| 95 |
* Reduce inlining of variable-size variant. In 0.1.5, the loop was not |
| 96 |
inlined, and it can be a bit large due to the auto-vectorization. Go |
| 97 |
back to how it was in 0.1.5, but allowing the compiler to inline if |
| 98 |
it believes it would be a speed gain. |
| 99 |
|
| 100 |
# 0.2.0 |
| 101 |
|
| 102 |
* Use inline assembly when available to hide from the optimizer. |
| 103 |
* When inline assembly is not available, use both a volatile read and |
| 104 |
disabled inlining. |
| 105 |
* Increase minimum Rust version to 1.59, which is the first with inline |
| 106 |
assembly. |
| 107 |
|
| 108 |
# 0.1.5 |
| 109 |
|
| 110 |
* Add fixed-size variant for arrays with sizes 16 bytes, 32 bytes, and |
| 111 |
64 bytes. |