Skip to main content

nodedb_query/simd_filter/
mod.rs

1//! SIMD-accelerated filter kernels returning u64 bitmasks.
2//!
3//! Each kernel compares a column slice against a scalar and returns a
4//! packed `Vec<u64>` where bit *i* is set iff the predicate holds for
5//! element *i*. One u64 word covers 64 rows.
6//!
7//! Runtime CPU detection selects the fastest path:
8//! - AVX-512 (512-bit, 16 u32 / 8 f64|i64 per op)
9//! - AVX2   (256-bit,  8 u32 / 4 f64|i64 per op)
10//! - Scalar fallback (auto-vectorized by LLVM)
11//!
12//! Companion helpers: `popcount`, `bitmask_and`, `bitmask_or`, `bitmask_to_indices`.
13
14pub(crate) mod avx2;
15pub(crate) mod avx512;
16pub(crate) mod bitmask;
17pub(crate) mod neon;
18pub(crate) mod runtime;
19pub(crate) mod scalar;
20pub(crate) mod wasm;
21
22#[cfg(test)]
23mod tests;
24
25pub use bitmask::{
26    bitmask_all, bitmask_and, bitmask_not, bitmask_or, bitmask_to_indices, popcount, words_for,
27};
28pub use runtime::{FilterSimdRuntime, filter_runtime};