diff --git a/src/lib.rs b/src/lib.rs index 1af4b20..dadb63b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 diff --git a/src/simd/mod.rs b/src/simd/mod.rs index 39e61ce..9635551 100644 --- a/src/simd/mod.rs +++ b/src/simd/mod.rs @@ -3,7 +3,6 @@ mod swar; #[cfg(any( httparse_disable_simd, miri, - not(feature = "std"), not(any( target_arch = "x86", target_arch = "x86_64", @@ -11,13 +10,27 @@ mod swar; 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", @@ -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", @@ -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( @@ -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( @@ -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", @@ -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", @@ -146,7 +157,6 @@ pub use self::avx2_compile_time::*; #[cfg(all( not(any(httparse_disable_simd, miri)), - feature = "std", target_arch = "aarch64", target_feature = "neon", ))] @@ -154,7 +164,6 @@ mod neon; #[cfg(all( not(any(httparse_disable_simd, miri)), - feature = "std", target_arch = "aarch64", target_feature = "neon", ))]