Skip to content
Open
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
9 changes: 6 additions & 3 deletions library/core/src/str/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,8 @@ impl<'b> Pattern for &'b str {

#[cfg(any(
all(target_arch = "x86_64", target_feature = "sse2"),
all(target_arch = "loongarch64", target_feature = "lsx")
all(target_arch = "loongarch64", target_feature = "lsx"),
all(target_arch = "aarch64", target_feature = "neon")
))]
if self.len() <= 32 {
if let Some(result) = simd_contains(self, haystack) {
Expand Down Expand Up @@ -1782,7 +1783,8 @@ impl TwoWayStrategy for RejectAndMatch {
/// [0]: http://0x80.pl/articles/simd-strfind.html#sse-avx2
#[cfg(any(
all(target_arch = "x86_64", target_feature = "sse2"),
all(target_arch = "loongarch64", target_feature = "lsx")
all(target_arch = "loongarch64", target_feature = "lsx"),
all(target_arch = "aarch64", target_feature = "neon")
))]
#[inline]
fn simd_contains(needle: &str, haystack: &str) -> Option<bool> {
Expand Down Expand Up @@ -1917,7 +1919,8 @@ fn simd_contains(needle: &str, haystack: &str) -> Option<bool> {
/// Both slices must have the same length.
#[cfg(any(
all(target_arch = "x86_64", target_feature = "sse2"),
all(target_arch = "loongarch64", target_feature = "lsx")
all(target_arch = "loongarch64", target_feature = "lsx"),
all(target_arch = "aarch64", target_feature = "neon")
))]
#[inline]
unsafe fn small_slice_eq(x: &[u8], y: &[u8]) -> bool {
Expand Down
Loading