1 use crate::{f16::F16, traits::Context};
2 use core::marker::PhantomData;
3 use core_simd::SimdF32;
5 #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Default)]
6 pub struct StdSimd<const LANES: usize>(PhantomData<[(); LANES]>);
8 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Default)]
9 pub struct Scalar<T, const LANES: usize>(pub T, PhantomData<[(); LANES]>);
11 impl<T, const LANES: usize> From<T> for Scalar<T, LANES> {
12 fn from(v: T) -> Self {
13 Scalar(v, PhantomData)
18 TODO(programmerjake): finish after splitting Context::VecBool
19 impl<const LANES: usize> Context for StdSimd<LANES> {
20 type Bool = Scalar<bool>;
23 type U16 = Scalar<u16>;
24 type I16 = Scalar<i16>;
25 type F16 = Scalar<F16>;
26 type U32 = Scalar<u32>;
27 type I32 = Scalar<i32>;
28 type F32 = Scalar<f32>;
29 type U64 = Scalar<u64>;
30 type I64 = Scalar<i64>;
31 type F64 = Scalar<f64>;