npsimd 0.3.0

An ergonomic library for architecture-specific vectorization.
Documentation
//! The Streaming SIMD Extensions.
//!
//! This generation of SIMD instructions operate on 16-byte (128-bit) vectors.
//! Intrinsics are implemented as methods on [`Use`]; see its documentation.

use super::*;

mod sse2;
pub use sse2::SSE2;

mod ssse3;
pub use ssse3::SSSE3;

mod sse4_1;
pub use sse4_1::SSE4_1;

/// The SSE feature set group.
pub struct FeatureGroup;

/// Support for the SSE generation of SIMD instructions.
pub struct Use<FS>
where FS: FeatureSet<FeatureGroup> {
    /// The set of supported features.
    _features: FS,
}

impl<FS> Use<FS>
where FS: FeatureSet<FeatureGroup> {
    /// Construct SSE support from a [`RuntimeSupport`].
    pub fn new(runtime: &RuntimeSupport) -> Option<Self> {
        Some(Self { _features: FS::get_support(runtime)? })
    }
}