1 use core
::arch
::x86_64
::__m256i
;
4 prefilter
::{PrefilterFnTy, PrefilterState}
,
8 // Check that the functions below satisfy the Prefilter function type.
9 const _
: PrefilterFnTy
= find
;
11 /// An AVX2 accelerated candidate finder for single-substring search.
15 /// Callers must ensure that the avx2 CPU feature is enabled in the current
17 #[target_feature(enable = "avx2")]
18 pub(crate) unsafe fn find(
19 prestate
: &mut PrefilterState
,
24 super::super::genericsimd
::find
::<__m256i
>(
37 fn prefilter_permutations() {
38 use crate::memmem
::prefilter
::tests
::PrefilterTest
;
39 if !is_x86_feature_detected
!("avx2") {
42 // SAFETY: The safety of super::find only requires that the current
43 // CPU support AVX2, which we checked above.
44 unsafe { PrefilterTest::run_all_tests(super::find) }
;