Skip to main content

Crate haagenti_simd

Crate haagenti_simd 

Source
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§

SimdLevel
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).