add SIMD swap_bytes/to_le#1
add SIMD swap_bytes/to_le#1TheIronBorn wants to merge 2 commits intopitdicker:simd_support_basicfrom
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.
Changing the argument order here is confusing. Keep the type at the end?
There was a problem hiding this comment.
It makes the macro invitation prettier but yeah I see how it could trip people up
| #[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.
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.
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 allnightlyfeatures whensimd_supportis enabled?