Add lanes()

This commit is contained in:
Magnus Ulimoen 2021-09-29 16:30:42 +00:00
parent afd7c5a5ee
commit 4fbccafc66

View File

@ -24,6 +24,11 @@ where
LaneCount<LANES>: SupportedLaneCount,
T: SimdElement,
{
/// Get the number of lanes in this vector.
pub const fn lanes(&self) -> usize {
LANES
}
/// Construct a SIMD vector by setting all lanes to the given value.
pub const fn splat(value: T) -> Self {
Self([value; LANES])