scanline-simd 0.1.0-alpha.0

Vectorised scan predicates for Scanline — AVX-512, AVX2, NEON, and a portable fallback behind one safe API.
Documentation
//! Portable fallback predicates.
//!
//! No intrinsics and no `unsafe`. LLVM autovectorises this well on most targets;
//! it exists both as the correctness oracle for the intrinsic backends and as the
//! path taken on aarch64 until the NEON backend lands, and in WASM.

/// Counts elements strictly greater than `target`.
#[must_use]
pub fn scan_gt_i64(data: &[i64], target: i64) -> usize {
    data.iter().filter(|&&x| x > target).count()
}

/// Counts elements strictly less than `target`.
#[must_use]
pub fn scan_lt_i64(data: &[i64], target: i64) -> usize {
    data.iter().filter(|&&x| x < target).count()
}

/// Counts elements equal to `target`.
#[must_use]
pub fn scan_eq_i64(data: &[i64], target: i64) -> usize {
    data.iter().filter(|&&x| x == target).count()
}