Skip to content

Commit

Permalink
Merge pull request #142 from rust-lang/feature/traits
Browse files Browse the repository at this point in the history
Combine LanesAtMost32 and SimdArray into a single trait "Vector"

Attempts to fix some unresolved questions in #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 #51.
  • Loading branch information
workingjubilee authored Jul 24, 2021
2 parents 732b7ed + 97c25dd commit 82e3405
Show file tree
Hide file tree
Showing 24 changed files with 637 additions and 820 deletions.
253 changes: 0 additions & 253 deletions crates/core_simd/src/array.rs

This file was deleted.

6 changes: 2 additions & 4 deletions crates/core_simd/src/comparisons.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use crate::LanesAtMost32;
use crate::{LaneCount, SupportedLaneCount};

macro_rules! implement_mask_ops {
{ $($vector:ident => $mask:ident ($inner_ty:ident),)* } => {
$(
impl<const LANES: usize> crate::$vector<LANES>
where
crate::$vector<LANES>: LanesAtMost32,
crate::$inner_ty<LANES>: LanesAtMost32,
crate::$mask<LANES>: crate::Mask,
LaneCount<LANES>: SupportedLaneCount,
{
/// Test if each lane is equal to the corresponding lane in `other`.
#[inline]
Expand Down
124 changes: 0 additions & 124 deletions crates/core_simd/src/first.rs

This file was deleted.

Loading

0 comments on commit 82e3405

Please sign in to comment.