Skip to content

Commit 5ce07dc

Browse files
Merge pull request #311 from Firstyear/20201123-improve-target-feature-docs
Add hardward features section to lib.rs docs
2 parents 158242f + c1630df commit 5ce07dc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib.rs

+14
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
//! - [Vector types](#vector-types)
1414
//! - [Conditional operations](#conditional-operations)
1515
//! - [Conversions](#conversions)
16+
//! - [Hardware Features](#hardware-features)
1617
//! - [Performance
1718
//! guide](https://rust-lang-nursery.github.io/packed_simd/perf-guide/)
1819
//!
@@ -198,6 +199,19 @@
198199
//!
199200
//! Numeric casts are not very "precise": sometimes lossy, sometimes value
200201
//! preserving, etc.
202+
//!
203+
//! ## Hardware Features
204+
//!
205+
//! This crate can use different hardware features based on your configured
206+
//! `RUSTFLAGS`. For example, with no configured `RUSTFLAGS`, `u64x8` on
207+
//! x86_64 will use SSE2 operations like `PCMPEQD`. If you configure
208+
//! `RUSTFLAGS='-C target-feature=+avx2,+avx'` on supported x86_64 hardware
209+
//! the same `u64x8` may use wider AVX2 operations like `VPCMPEQQ`. It is
210+
//! important for performance and for hardware support requirements that
211+
//! you choose an appropriate set of `target-feature` and `target-cpu`
212+
//! options during builds. For more information, see the [Performance
213+
//! guide](https://rust-lang-nursery.github.io/packed_simd/perf-guide/)
214+
//!
201215
202216
#![feature(
203217
repr_simd,

0 commit comments

Comments
 (0)