Skip to content
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

Fix "simd_support" feature #1056

Merged
merged 3 commits into from Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Expand Up @@ -61,8 +61,8 @@ serde = { version = "1.0.103", features = ["derive"], optional = true }

[dependencies.packed_simd]
# NOTE: so far no version works reliably due to dependence on unstable features
version = "0.3"
# git = "https://github.com/rust-lang-nursery/packed_simd"
package = "packed_simd_2"
version = "0.3.4"
optional = true
features = ["into_bits"]

Expand Down
6 changes: 3 additions & 3 deletions src/distributions/integer.rs
Expand Up @@ -11,9 +11,9 @@
use crate::distributions::{Distribution, Standard};
use crate::Rng;
#[cfg(all(target_arch = "x86", feature = "simd_support"))]
use core::arch::x86::{__m64, __m128i, __m256i};
use core::arch::x86::{__m128i, __m256i};
#[cfg(all(target_arch = "x86_64", feature = "simd_support"))]
use core::arch::x86_64::{__m64, __m128i, __m256i};
use core::arch::x86_64::{__m128i, __m256i};
#[cfg(not(target_os = "emscripten"))] use core::num::NonZeroU128;
use core::num::{NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize};
#[cfg(feature = "simd_support")] use packed_simd::*;
Expand Down Expand Up @@ -158,7 +158,7 @@ simd_impl!(512, u8x64, i8x64, u16x32, i16x32, u32x16, i32x16, u64x8, i64x8,);
feature = "simd_support",
any(target_arch = "x86", target_arch = "x86_64")
))]
simd_impl!((__m64, u8x8), (__m128i, u8x16), (__m256i, u8x32),);
simd_impl!((__m128i, u8x16), (__m256i, u8x32),);

#[cfg(test)]
mod tests {
Expand Down
3 changes: 0 additions & 3 deletions src/distributions/utils.rs
Expand Up @@ -159,7 +159,6 @@ mod simd_wmul {
}

wmul_impl! { (u16x2, u32x2),, 16 }
#[cfg(not(target_feature = "sse2"))]
wmul_impl! { (u16x4, u32x4),, 16 }
#[cfg(not(target_feature = "sse4.2"))]
wmul_impl! { (u16x8, u32x8),, 16 }
Expand All @@ -186,8 +185,6 @@ mod simd_wmul {
};
}

#[cfg(target_feature = "sse2")]
wmul_impl_16! { u16x4, __m64, _mm_mulhi_pu16, _mm_mullo_pi16 }
#[cfg(target_feature = "sse4.2")]
vks marked this conversation as resolved.
Show resolved Hide resolved
wmul_impl_16! { u16x8, __m128i, _mm_mulhi_epu16, _mm_mullo_epi16 }
#[cfg(target_feature = "avx2")]
Expand Down