[dependencies]
half = { version = "1.7.1", optional = true }
typed-arena = { version = "2.0.1", optional = true }
+core_simd = { version = "0.1.0", git = "https://github.com/rust-lang/stdsimd", optional = true }
[features]
default = ["f16", "fma"]
fma = ["std"]
std = []
ir = ["std", "typed-arena"]
+stdsimd = ["core_simd"]
--- /dev/null
+use crate::{f16::F16, traits::Context};
+use core::marker::PhantomData;
+use core_simd::SimdF32;
+
+#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Default)]
+pub struct StdSimd<const LANES: usize>(PhantomData<[(); LANES]>);
+
+#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Default)]
+pub struct Scalar<T, const LANES: usize>(pub T, PhantomData<[(); LANES]>);
+
+impl<T, const LANES: usize> From<T> for Scalar<T, LANES> {
+ fn from(v: T) -> Self {
+ Scalar(v, PhantomData)
+ }
+}
+
+/*
+TODO(programmerjake): finish after splitting Context::VecBool
+impl<const LANES: usize> Context for StdSimd<LANES> {
+ type Bool = Scalar<bool>;
+ type U8 = Scalar<u8>;
+ type I8 = Scalar<i8>;
+ type U16 = Scalar<u16>;
+ type I16 = Scalar<i16>;
+ type F16 = Scalar<F16>;
+ type U32 = Scalar<u32>;
+ type I32 = Scalar<i32>;
+ type F32 = Scalar<f32>;
+ type U64 = Scalar<u64>;
+ type I64 = Scalar<i64>;
+ type F64 = Scalar<f64>;
+ type VecBool;
+ type VecU8;
+ type VecI8;
+ type VecU16;
+ type VecI16;
+ type VecF16;
+ type VecU32;
+ type VecI32;
+ type VecF32;
+ type VecU64;
+ type VecI64;
+ type VecF64;
+}
+*/