Skip to content

Combine LanesAtMost32 and SimdArray into a single trait "Vector" #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 24, 2021

Conversation

calebzulawski
Copy link
Member

@calebzulawski calebzulawski commented Jun 28, 2021

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.

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the first line of code
greets the cutting room floor
soon, the raking begins

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really good! Hopefully we can work a little magic with the traits Soon™ but this is exciting and anything we do will almost certainly be predicated on this changeset.

crate::$vector<LANES>: LanesAtMost32,
crate::$inner_ty<LANES>: LanesAtMost32,
crate::$mask<LANES>: crate::Mask,
LaneCount<LANES>: SupportedLaneCount,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this kind of thing is a huge improvement! And hopefully will make some other simplifications easier.

Comment on lines +35 to +36
mod lane_count;
pub use lane_count::*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return of LanesAtMost: General Trait Bound's Revenge

@workingjubilee workingjubilee merged commit 82e3405 into master Jul 24, 2021
@calebzulawski calebzulawski deleted the feature/traits branch July 25, 2021 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve wasm32 to_array performance
2 participants