diff --git a/src/distr/integer.rs b/src/distr/integer.rs index 3f8b3df39f..1d83241513 100644 --- a/src/distr/integer.rs +++ b/src/distr/integer.rs @@ -159,10 +159,7 @@ macro_rules! simd_impl { /// /// [`simd_support`]: https://github.com/rust-random/rand#crate-features #[cfg(feature = "simd_support")] - impl Distribution> for StandardUniform - where - LaneCount: SupportedLaneCount, - { + impl Distribution> for StandardUniform { #[inline] fn sample(&self, rng: &mut R) -> Simd<$ty, LANES> { let mut vec = Simd::default(); diff --git a/src/distr/other.rs b/src/distr/other.rs index 1c11eb326b..d752552f51 100644 --- a/src/distr/other.rs +++ b/src/distr/other.rs @@ -20,9 +20,9 @@ use crate::distr::{Distribution, StandardUniform, Uniform}; use crate::{Rng, RngExt}; #[cfg(feature = "simd_support")] -use core::simd::prelude::*; +use core::simd::MaskElement; #[cfg(feature = "simd_support")] -use core::simd::{LaneCount, MaskElement, SupportedLaneCount}; +use core::simd::prelude::*; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; @@ -234,7 +234,6 @@ impl Distribution for StandardUniform { impl Distribution> for StandardUniform where T: MaskElement + Default, - LaneCount: SupportedLaneCount, StandardUniform: Distribution>, Simd: SimdPartialOrd>, { diff --git a/src/distr/uniform_float.rs b/src/distr/uniform_float.rs index 2d7d1be21c..3e91c0f3a0 100644 --- a/src/distr/uniform_float.rs +++ b/src/distr/uniform_float.rs @@ -16,8 +16,6 @@ use crate::{Rng, RngExt}; #[cfg(feature = "simd_support")] use core::simd::prelude::*; -// #[cfg(feature = "simd_support")] -// use core::simd::{LaneCount, SupportedLaneCount}; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; diff --git a/src/distr/uniform_int.rs b/src/distr/uniform_int.rs index de530523eb..865d63f69d 100644 --- a/src/distr/uniform_int.rs +++ b/src/distr/uniform_int.rs @@ -16,9 +16,7 @@ use crate::distr::{Distribution, StandardUniform}; use crate::{Rng, RngExt}; #[cfg(feature = "simd_support")] -use core::simd::prelude::*; -#[cfg(feature = "simd_support")] -use core::simd::{LaneCount, SupportedLaneCount}; +use core::simd::{Select, prelude::*}; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; @@ -283,7 +281,6 @@ macro_rules! uniform_simd_int_impl { #[cfg(feature = "simd_support")] impl SampleUniform for Simd<$ty, LANES> where - LaneCount: SupportedLaneCount, Simd<$unsigned, LANES>: WideningMultiply, Simd<$unsigned, LANES>)>, StandardUniform: Distribution>, @@ -294,7 +291,6 @@ macro_rules! uniform_simd_int_impl { #[cfg(feature = "simd_support")] impl UniformSampler for UniformInt> where - LaneCount: SupportedLaneCount, Simd<$unsigned, LANES>: WideningMultiply, Simd<$unsigned, LANES>)>, StandardUniform: Distribution>, diff --git a/src/distr/utils.rs b/src/distr/utils.rs index bb9e7006c1..d3cfbf6a0f 100644 --- a/src/distr/utils.rs +++ b/src/distr/utils.rs @@ -9,9 +9,9 @@ //! Math helper functions #[cfg(feature = "simd_support")] -use core::simd::prelude::*; +use core::simd::SimdElement; #[cfg(feature = "simd_support")] -use core::simd::{LaneCount, SimdElement, SupportedLaneCount}; +use core::simd::prelude::*; pub(crate) trait WideningMultiply { type Output; @@ -337,10 +337,7 @@ scalar_float_impl!(f64, u64); #[cfg(feature = "simd_support")] macro_rules! simd_impl { ($fty:ident, $uty:ident) => { - impl FloatSIMDUtils for Simd<$fty, LANES> - where - LaneCount: SupportedLaneCount, - { + impl FloatSIMDUtils for Simd<$fty, LANES> { type Mask = Mask<<$fty as SimdElement>::Mask, LANES>; type UInt = Simd<$uty, LANES>; @@ -373,7 +370,7 @@ macro_rules! simd_impl { // value representable by $fty. This works even when the // current value is infinity. debug_assert!(mask.any(), "At least one lane must be set"); - Self::from_bits(self.to_bits() + mask.to_int().cast()) + Self::from_bits(self.to_bits() + mask.to_simd().cast()) } #[inline] @@ -383,10 +380,7 @@ macro_rules! simd_impl { } #[cfg(test)] - impl FloatSIMDScalarUtils for Simd<$fty, LANES> - where - LaneCount: SupportedLaneCount, - { + impl FloatSIMDScalarUtils for Simd<$fty, LANES> { type Scalar = $fty; #[inline]