Skip to content

Commit 82e3405

Browse files
Merge pull request rust-lang#142 from rust-lang/feature/traits
Combine LanesAtMost32 and SimdArray into a single trait "Vector" Attempts to fix some unresolved questions in rust-lang#139 regarding `SimdArray` having a generic parameter. In particular, this made it not appropriate for replacing `LanesAtMost32`. Additionally, it made it impossible to use in a context where you otherwise don't know the lane count, e.g. `impl Vector`. An unfortunate side effect of this change is that scatter/gather no longer work in the trait (nor does anything else that references the lane count in a type. This requires the super-unstable `const_evaluatable_checked` feature). I also threw in the change from `as_slice` to `as_array` as discussed in zulip, and fixes rust-lang#51.
2 parents 732b7ed + 97c25dd commit 82e3405

24 files changed

+637
-820
lines changed

crates/core_simd/src/array.rs

-253
This file was deleted.

crates/core_simd/src/comparisons.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
use crate::LanesAtMost32;
1+
use crate::{LaneCount, SupportedLaneCount};
22

33
macro_rules! implement_mask_ops {
44
{ $($vector:ident => $mask:ident ($inner_ty:ident),)* } => {
55
$(
66
impl<const LANES: usize> crate::$vector<LANES>
77
where
8-
crate::$vector<LANES>: LanesAtMost32,
9-
crate::$inner_ty<LANES>: LanesAtMost32,
10-
crate::$mask<LANES>: crate::Mask,
8+
LaneCount<LANES>: SupportedLaneCount,
119
{
1210
/// Test if each lane is equal to the corresponding lane in `other`.
1311
#[inline]

crates/core_simd/src/first.rs

-124
This file was deleted.

0 commit comments

Comments
 (0)