Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//! parsing internals use an `Iterator` instead of direct indexing, while
//! skipping bounds checks.
//!
//! With Rust 1.27.0 or later, support for SIMD is enabled automatically.
//! SIMD optimizations are enabled automatically when available.
//! If building an executable to be run on multiple platforms, and thus
//! not passing `target_feature` or `target_cpu` flags to the compiler,
//! runtime detection can still detect SSE4.2 or AVX2 support to provide
Expand Down
31 changes: 20 additions & 11 deletions src/simd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,34 @@ mod swar;
#[cfg(any(
httparse_disable_simd,
miri,
not(feature = "std"),
not(any(
target_arch = "x86",
target_arch = "x86_64",
all(
target_arch = "aarch64",
target_feature = "neon",
)
))
)),
all(
not(feature = "std"),
not(any(
target_feature = "sse4.2",
target_feature = "avx2",
)),
any(
target_arch = "x86",
target_arch = "x86_64",
),
)
))]
pub use self::swar::*;

#[cfg(all(
not(any(httparse_disable_simd, miri)),
feature = "std",
any(
feature = "std",
target_feature = "sse4.2",
),
not(target_feature = "avx2"),
any(
target_arch = "x86",
Expand All @@ -28,10 +41,12 @@ mod sse42;

#[cfg(all(
not(any(httparse_disable_simd, miri)),
feature = "std",
any(
target_feature = "avx2",
not(target_feature = "sse4.2"),
all(
feature = "std",
not(target_feature = "sse4.2"),
),
),
any(
target_arch = "x86",
Expand Down Expand Up @@ -70,7 +85,6 @@ pub use self::runtime::*;

#[cfg(all(
not(any(httparse_disable_simd, miri)),
feature = "std",
target_feature = "sse4.2",
not(target_feature = "avx2"),
any(
Expand All @@ -97,7 +111,6 @@ mod sse42_compile_time {

#[cfg(all(
not(any(httparse_disable_simd, miri)),
feature = "std",
target_feature = "sse4.2",
not(target_feature = "avx2"),
any(
Expand All @@ -109,7 +122,6 @@ pub use self::sse42_compile_time::*;

#[cfg(all(
not(any(httparse_disable_simd, miri)),
feature = "std",
target_feature = "avx2",
any(
target_arch = "x86",
Expand All @@ -135,7 +147,6 @@ mod avx2_compile_time {

#[cfg(all(
not(any(httparse_disable_simd, miri)),
feature = "std",
target_feature = "avx2",
any(
target_arch = "x86",
Expand All @@ -146,15 +157,13 @@ pub use self::avx2_compile_time::*;

#[cfg(all(
not(any(httparse_disable_simd, miri)),
feature = "std",
target_arch = "aarch64",
target_feature = "neon",
))]
mod neon;

#[cfg(all(
not(any(httparse_disable_simd, miri)),
feature = "std",
target_arch = "aarch64",
target_feature = "neon",
))]
Expand Down