Skip to content

Commit ef80b13

Browse files
committed
AVX 512 doc
1 parent 3b27412 commit ef80b13

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ This library has been thoroughly tested with sample data as well as fuzzing and
1313
## Features
1414
* `basic` API for the fastest validation, optimized for valid UTF-8
1515
* `compat` API as a fully compatible replacement for `std::str::from_utf8()`
16+
* 🆕 AVX 512 support on modern x86/x86-64 CPUs since Rust 1.89
1617
* Supports AVX 2 and SSE 4.2 implementations on x86 and x86-64
1718
* ARM64 (aarch64) SIMD is supported since Rust 1.61
1819
* WASM (wasm32) SIMD is supported
1920
* 🆕 armv7 NEON support with the `armv7_neon` feature on nightly Rust
20-
* x86-64: Up to 23 times faster than the std library on valid non-ASCII, up to four times faster on ASCI
21+
* x86-64: Up to 23 times faster than the std library on valid non-ASCII, up to four times faster on ASCII
2122
* aarch64: Up to eleven times faster than the std library on valid non-ASCII, up to four times faster on ASCII (Apple Silicon)
2223
* Faster than the original simdjson implementation
2324
* Selects the fastest implementation at runtime based on CPU support (on x86)
@@ -71,14 +72,17 @@ This comes at a slight performance penalty compared to the `basic` API even if t
7172
## Implementation selection
7273

7374
### X86
74-
The fastest implementation is selected at runtime using the `std::is_x86_feature_detected!` macro, unless the CPU
75-
targeted by the compiler supports the fastest available implementation.
76-
So if you compile with `RUSTFLAGS="-C target-cpu=native"` on a recent x86-64 machine, the AVX 2 implementation is selected at
77-
compile-time and runtime selection is disabled.
75+
The fastest implementation is usually selected at runtime using the `std::is_x86_feature_detected!` macro. The AVX 512
76+
implementation is however only selected if the CPU support the VBMI2 features to avoid throttling happening with CPUs before
77+
Intels Ice Lake microarchitecture.
78+
79+
If you compile with `RUSTFLAGS="-C target-cpu=native"` on a recent x86-64 machine whichs support AVX 512 with Rust 1.89 or later,
80+
the AVX 512 implementation is selected at compile-time and runtime selection is disabled.
7881

7982
For no-std support (compiled with `--no-default-features`) the implementation is always selected at compile time based on
8083
the targeted CPU. Use `RUSTFLAGS="-C target-feature=+avx2"` for the AVX 2 implementation or `RUSTFLAGS="-C target-feature=+sse4.2"`
81-
for the SSE 4.2 implementation.
84+
for the SSE 4.2 implementation. For AVX 512 use `RUSTFLAGS="-C target-feature=+avx512f,+avx512bw,+avx512vbmi,+avx512vbmi2"` with
85+
Rust 1.89 or later.
8286

8387
### ARM64
8488
The SIMD implementation is used automatically since Rust 1.61.

0 commit comments

Comments
 (0)