-
Notifications
You must be signed in to change notification settings - Fork 0
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
add SIMD swap_bytes/to_le #1
add SIMD swap_bytes/to_le #1
Conversation
|
||
// bulk impl for a shuffle intrinsic/vector width | ||
($vec8:ident, $shuf:ident, $indices:expr, $($ty:ident,)+) => ($( | ||
impl_swap_bytes! { $ty, $vec8, $shuf, $indices } |
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.
Changing the argument order here is confusing. Keep the type at the end?
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.
It makes the macro invitation prettier but yeah I see how it could trip people up
src/distributions/utils.rs
Outdated
#[cfg(feature = "simd_support")] | ||
extern "platform-intrinsic" { | ||
fn simd_shuffle2<T, U>(a: T, b: T, indices: [u32; 2]) -> U; | ||
fn simd_shuffle4<T, U>(a: T, b: T, indices: [u32; 4]) -> U; |
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.
Where's the documentation on these?
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.
I don’t think there is any. I think this is where they’re defined https://github.com/rust-lang/rust/blob/2612bbcba08dd81730edd8f2139005fb7a409294/src/librustc_codegen_llvm/intrinsic.rs#L1056
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.
You could look at the planned API documentation rust-lang/stdarch#387 (we should mention this PR explicitly)
Nice! A lot of code... Wasn't stdsimd open for endianness conversion functions?
This is a kind of messy compromise I ended up with for O, and why is this PR opened against my repro? To get it into the PR that I half neglected (sorry)? |
@dhardy recommended I make this pull against your branch. Not sure if this is what they meant, but it felt better than breaking reproducibility for a moment then making my own pull. |
I’m not sure what you mean by this |
I should probably make a |
Sent a PR rust-lang/stdarch#509 |
Fixed a couple nits |
This also includes's dhardy's recommended
mem::size_of::<$ty>()
rust-random#523 (comment).Note: builds currently fail with
--features simd_support
. Should we also enable allnightly
features whensimd_support
is enabled?