Skip to content

Commit b7f93cf

Browse files
committed
Remove bitmasks from LaneCount
1 parent 744169a commit b7f93cf

File tree

1 file changed

+8
-30
lines changed

1 file changed

+8
-30
lines changed

crates/core_simd/src/lane_count.rs

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,15 @@ use sealed::Sealed;
66
/// A type representing a vector lane count.
77
pub struct LaneCount<const LANES: usize>;
88

9-
impl<const LANES: usize> LaneCount<LANES> {
10-
/// The number of bytes in a bitmask with this many lanes.
11-
pub const BITMASK_LEN: usize = (LANES + 7) / 8;
12-
}
13-
149
/// Helper trait for vector lane counts.
15-
pub trait SupportedLaneCount: Sealed {
16-
#[doc(hidden)]
17-
type BitMask: Copy + Default + AsRef<[u8]> + AsMut<[u8]>;
18-
}
10+
pub trait SupportedLaneCount: Sealed {}
1911

2012
impl<const LANES: usize> Sealed for LaneCount<LANES> {}
2113

22-
impl SupportedLaneCount for LaneCount<1> {
23-
type BitMask = [u8; 1];
24-
}
25-
impl SupportedLaneCount for LaneCount<2> {
26-
type BitMask = [u8; 1];
27-
}
28-
impl SupportedLaneCount for LaneCount<4> {
29-
type BitMask = [u8; 1];
30-
}
31-
impl SupportedLaneCount for LaneCount<8> {
32-
type BitMask = [u8; 1];
33-
}
34-
impl SupportedLaneCount for LaneCount<16> {
35-
type BitMask = [u8; 2];
36-
}
37-
impl SupportedLaneCount for LaneCount<32> {
38-
type BitMask = [u8; 4];
39-
}
40-
impl SupportedLaneCount for LaneCount<64> {
41-
type BitMask = [u8; 8];
42-
}
14+
impl SupportedLaneCount for LaneCount<1> {}
15+
impl SupportedLaneCount for LaneCount<2> {}
16+
impl SupportedLaneCount for LaneCount<4> {}
17+
impl SupportedLaneCount for LaneCount<8> {}
18+
impl SupportedLaneCount for LaneCount<16> {}
19+
impl SupportedLaneCount for LaneCount<32> {}
20+
impl SupportedLaneCount for LaneCount<64> {}

0 commit comments

Comments
 (0)