Add lanes() and associated LANES const
This commit is contained in:
commit
436ca7f7aa
1 changed files with 8 additions and 0 deletions
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue