Expand description
§Haagenti SIMD
SIMD-accelerated primitives for compression algorithms.
Provides optimized implementations of common compression operations using platform-specific SIMD instructions.
§Supported Architectures
- x86_64: SSE4.2, AVX2, AVX-512
- aarch64: NEON, SVE
- Fallback: Scalar implementation
§Example
ⓘ
use haagenti_simd::{detect_simd, SimdLevel};
match detect_simd() {
SimdLevel::Avx512 => println!("Using AVX-512"),
SimdLevel::Avx2 => println!("Using AVX2"),
SimdLevel::Neon => println!("Using NEON"),
SimdLevel::None => println!("Scalar fallback"),
}Enums§
- Simd
Level - SIMD feature level.
Functions§
- byte_
histogram - Compute byte histogram (frequency of each byte value 0-255).
- byte_
histogram_ simd - SIMD-accelerated histogram using scatter/gather approach.
- copy_
match - Copy a match from earlier in the output buffer.
- copy_
within_ extend - Copy bytes from source to destination with potential overlap.
- detect_
simd - Detect available SIMD level at runtime.
- fill_
repeat - Fill buffer with a repeating pattern.
- find_
match_ length - Find the length of matching bytes between two slices.
- find_
match_ length_ safe - Safe version that doesn’t use unsafe operations. Slightly slower but guaranteed safe.
- has_
avx2 - Check if AVX2 is available.
- has_
avx512 - Check if AVX-512 is available.
- has_
neon - Check if NEON is available.
- hash4_
scalar - Compute hash for a single 4-byte sequence (scalar).
- hash4x4
- Compute hashes for 4 consecutive positions using best available SIMD.
- hash4x8
- Compute hashes for 8 consecutive positions using AVX2.
- simd_
level - Get the current SIMD level (cached).