Add lanes() and associated LANES const

This commit is contained in:
Jubilee 2021-09-29 14:19:45 -07:00 committed by GitHub
commit 436ca7f7aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,14 @@ where
LaneCount<LANES>: SupportedLaneCount,
T: SimdElement,
{
/// Number of lanes in this vector.
pub const LANES: usize = LANES;
/// 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])