Skip to main content

Crate truce_simd

Crate truce_simd 

Source
Expand description

Portable SIMD primitives + canonical block-rate audio ops.

Two backends, feature-gated:

  • wide-backend (default): stable Rust, uses the wide crate. Maps f32x4/f32x8/f64x2/f64x4 onto SSE2 / AVX2 on x86, NEON on AArch64, scalar fallback elsewhere.
  • (planned) portable-simd-backend: nightly-only, swaps in core::simd when it stabilizes. Same public type aliases.

Consumers never name the backend - they import truce_simd::ops (f32) / truce_simd::ops64 (f64) and the correct intrinsics get wired in automatically.

All ops here are pure math. No atomics, no parameter reads, no audio-thread allocation. They’re meant to be the inner-loop complement to a truce_params::FloatParam::read_block::<N>() / truce_core::AudioBuffer::chunks_mut::<N>() driver in process().

Modules§

math
Vectorized transcendentals at audio-grade precision.
ops
Block-rate audio ops at f32. See crate::ops64 for the f64 mirror.
ops64
Block-rate audio ops at f64. Mirror of crate::ops (f32); see that module for the per-op contracts. The wider lane width means f64x4 SIMD lanes for the same wide backend; chunk granularity is 4 instead of 8.
simd
Lane-width aliases. Stable across backends so consumers don’t have to rewrite types when we flip the default to portable-simd-backend.