generic_simd/vector/width.rs
1//! Types indicating widths of vectors.
2
3/// Indicates the width of a vector.
4pub trait Width {
5 const VALUE: usize;
6}
7
8/// Indicates a vector contains 1 lane.
9pub struct W1;
10
11/// Indicates a vector contains 2 lanes.
12pub struct W2;
13
14/// Indicates a vector contains 4 lanes.
15pub struct W4;
16
17/// Indicates a vector contains 8 lanes.
18pub struct W8;
19
20impl Width for W1 {
21 const VALUE: usize = 1;
22}
23
24impl Width for W2 {
25 const VALUE: usize = 2;
26}
27
28impl Width for W4 {
29 const VALUE: usize = 4;
30}
31
32impl Width for W8 {
33 const VALUE: usize = 8;
34}