Skip to content

Commit

Permalink
doc: SIMD is enabled automatically
Browse files Browse the repository at this point in the history
This was done in #490, but the documentation wasn't updated.

Closes #491
  • Loading branch information
BurntSushi committed Jun 21, 2018
1 parent 5fd3bd1 commit 77140e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
8 changes: 1 addition & 7 deletions README.md
Expand Up @@ -191,13 +191,7 @@ assert!(matches.matched(6));

### Usage: enable SIMD optimizations

This crate provides an `unstable` feature that can only be enabled on nightly
Rust. When this feature is enabled, the regex crate will use SIMD optimizations
if your CPU supports them. No additional compile time flags are required; the
regex crate will detect your CPU support at runtime.

When `std::arch` becomes stable, then these optimizations will be enabled
automatically.
SIMD optimizations are enabled automatically on Rust stable 1.27 and newer.


### Usage: a regular expression parser
Expand Down
10 changes: 3 additions & 7 deletions build.rs
Expand Up @@ -15,13 +15,9 @@ fn main() {
}

fn enable_simd_optimizations(version: &str) {
// If we're using nightly Rust, then we can enable vector optimizations.
// Note that these aren't actually activated unless the `unstable` feature
// is enabled.
//
// We also don't activate these if we've explicitly disabled auto
// optimizations. Disabling auto optimizations is intended for use in
// tests, so that we can reliably test fallback implementations.
// We don't activate SIMD optimizations these if we've explicitly disabled
// them. Disabling auto optimizations is intended for use in tests, so that
// we can reliably test fallback implementations.
if env::var_os("CARGO_CFG_REGEX_DISABLE_AUTO_OPTIMIZATIONS").is_some() {
return;
}
Expand Down

0 comments on commit 77140e7

Please sign in to comment.