-
Notifications
You must be signed in to change notification settings - Fork 87
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
Conversation
There was a problem hiding this 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
3ba0687
to
97c25dd
Compare
There was a problem hiding this 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, |
There was a problem hiding this comment.
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.
mod lane_count; | ||
pub use lane_count::*; |
There was a problem hiding this comment.
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
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
toas_array
as discussed in zulip, and fixes #51.