Skip to main content

Module vector

Module vector 

Source
Expand description

§Vector operations for DSP

This module provides an embedded domain-specific language (eDSL) for vector operations optimised with SIMD instructions.

§Features

  • Basic vector types for f32 and f64 with various SIMD lane widths
  • Arithmetic operations (+, -, *, /, %)
  • Math functions (sin, cos, exp, ln, sqrt, …)
  • Expression system for lazy evaluation and optimisations
  • Automatic CPU SIMD capability detection

§Usage

use rill_core::vector::prelude::*;

let a = ScalarVector4::splat(1.0);
let b = ScalarVector4::splat(2.0);
let c = a + b;
assert_eq!(c, ScalarVector4::splat(3.0));

§Architecture

  • traits — core traits (Vector, VectorOps, VectorMath)
  • ops — arithmetic operator implementations
  • math — math function implementations
  • simd — SIMD backends for different architectures
  • expr — expression system and optimisations
  • scalar — scalar fallback implementations

§Supported platforms

  • x86/x86_64: SSE2, SSE4.1, AVX, AVX2, AVX512 (runtime detection)
  • ARM: NEON (AArch64)
  • WebAssembly: SIMD128
  • Scalar fallback for platforms without SIMD

Re-exports§

pub use math::*;
pub use ops::*;
pub use traits::*;
pub use macros::*;
pub use scalar::*;

Modules§

macros
Vector construction macros. Макросы для удобного построения векторных выражений.
math
Vector math functions (sin, cos, etc.).
ops
Arithmetic operator implementations for vectors.
prelude
Convenience prelude for importing all vector types and traits.
scalar
Scalar fallback vector implementations.
simdx86 or x86-64
SIMD-accelerated vector implementations.
traits
Core vector traits (Vector, VectorTranscendental, etc.).