fearless_simd 0.7.0

Safer and easier SIMD
Documentation
// Copyright 2025 the Fearless_SIMD Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

#![expect(
    missing_docs,
    clippy::cast_possible_truncation,
    clippy::unseparated_literal_suffix,
    clippy::use_self,
    clippy::wrong_self_convention,
    reason = "Simplifies the generator and has no effect on the machine code"
)]
#![allow(
    trivial_numeric_casts,
    clippy::unnecessary_cast,
    clippy::new_without_default,
    reason = "Simplifies the generator and has no effect on the machine code, only tripped by some backends"
)]

//! A module containing generated files
//!
//! All files in this subdirectory are autogenerated by the `fearless_simd_gen` crate.

// Fallback is unnecessary exactly when one of our SIMD backends is guaranteed as the baseline.
// Keep this predicate in sync with `Level::Fallback` and `dispatch!`.
macro_rules! with_fallback {
    ($($item:item)*) => {$(
        #[cfg(any(
            feature = "force_support_fallback",
            not(any(
                all(target_arch = "aarch64", target_feature = "neon"),
                all(
                    any(target_arch = "x86", target_arch = "x86_64"),
                    target_feature = "sse2",
                    target_feature = "fxsr"
                ),
                all(target_arch = "wasm32", target_feature = "simd128")
            ))
        ))]
        $item
    )*};
}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod avx2;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod avx512;
with_fallback! {
    mod fallback;
}
#[cfg(target_arch = "aarch64")]
mod neon;
mod ops;
pub(crate) mod simd_trait;
mod simd_types;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod sse2;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod sse4_2;
#[cfg(all(target_arch = "wasm32", target_feature = "simd128"))]
mod wasm;

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub use avx2::*;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub use avx512::*;
with_fallback! {
    pub use fallback::*;
}
#[cfg(target_arch = "aarch64")]
pub use neon::*;
pub use simd_trait::*;
pub use simd_types::*;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub use sse2::*;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub use sse4_2::*;
#[cfg(all(target_arch = "wasm32", target_feature = "simd128"))]
pub use wasm::*;