1 use core
::arch
::x86_64
::__m128i
;
4 prefilter
::{PrefilterFnTy, PrefilterState}
,
8 // Check that the functions below satisfy the Prefilter function type.
9 const _
: PrefilterFnTy
= find
;
11 /// An SSE2 accelerated candidate finder for single-substring search.
15 /// Callers must ensure that the sse2 CPU feature is enabled in the current
16 /// environment. This feature should be enabled in all x86_64 targets.
17 #[target_feature(enable = "sse2")]
18 pub(crate) unsafe fn find(
19 prestate
: &mut PrefilterState
,
24 super::super::genericsimd
::find
::<__m128i
>(
29 super::super::simple_memchr_fallback
,
33 #[cfg(all(test, feature = "std"))]
37 fn prefilter_permutations() {
38 use crate::memmem
::prefilter
::tests
::PrefilterTest
;
39 // SAFETY: super::find is safe to call for all inputs on x86.
40 unsafe { PrefilterTest::run_all_tests(super::find) }
;