diff --git a/crates/core_simd/src/masks/to_bitmask.rs b/crates/core_simd/src/masks/to_bitmask.rs index fc7d6b781f2..8e724c9de8c 100644 --- a/crates/core_simd/src/masks/to_bitmask.rs +++ b/crates/core_simd/src/masks/to_bitmask.rs @@ -74,6 +74,7 @@ impl_integer_intrinsic! { /// Returns the minimum number of bytes in a bitmask with `lanes` lanes. #[cfg(feature = "generic_const_exprs")] +#[allow(clippy::missing_inline_in_public_items)] pub const fn bitmask_len(lanes: usize) -> usize { (lanes + 7) / 8 } diff --git a/crates/core_simd/src/ops/shift_scalar.rs b/crates/core_simd/src/ops/shift_scalar.rs index 77aac656395..f5115a5a5e9 100644 --- a/crates/core_simd/src/ops/shift_scalar.rs +++ b/crates/core_simd/src/ops/shift_scalar.rs @@ -10,6 +10,7 @@ macro_rules! impl_splatted_shifts { LaneCount: SupportedLaneCount, { type Output = Self; + #[inline] fn $trait_fn(self, rhs: $ty) -> Self::Output { self.$trait_fn(Simd::splat(rhs)) } @@ -20,6 +21,7 @@ macro_rules! impl_splatted_shifts { LaneCount: SupportedLaneCount, { type Output = Self; + #[inline] fn $trait_fn(self, rhs: &$ty) -> Self::Output { self.$trait_fn(Simd::splat(*rhs)) } @@ -30,6 +32,7 @@ macro_rules! impl_splatted_shifts { LaneCount: SupportedLaneCount, { type Output = Simd<$ty, N>; + #[inline] fn $trait_fn(self, rhs: $ty) -> Self::Output { self.$trait_fn(Simd::splat(rhs)) } @@ -40,6 +43,7 @@ macro_rules! impl_splatted_shifts { LaneCount: SupportedLaneCount, { type Output = Simd<$ty, N>; + #[inline] fn $trait_fn(self, rhs: &$ty) -> Self::Output { self.$trait_fn(Simd::splat(*rhs)) } diff --git a/crates/core_simd/src/to_bytes.rs b/crates/core_simd/src/to_bytes.rs index 563b0c95a8a..5f1374fd5a5 100644 --- a/crates/core_simd/src/to_bytes.rs +++ b/crates/core_simd/src/to_bytes.rs @@ -9,6 +9,7 @@ macro_rules! impl_to_bytes { { /// Return the memory representation of this integer as a byte array in native byte /// order. + #[inline] pub fn to_ne_bytes(self) -> crate::simd::Simd { // Safety: transmuting between vectors is safe unsafe { core::mem::transmute_copy(&self) } @@ -16,6 +17,7 @@ macro_rules! impl_to_bytes { /// Return the memory representation of this integer as a byte array in big-endian /// (network) byte order. + #[inline] pub fn to_be_bytes(self) -> crate::simd::Simd { let bytes = self.to_ne_bytes(); if cfg!(target_endian = "big") { @@ -27,6 +29,7 @@ macro_rules! impl_to_bytes { /// Return the memory representation of this integer as a byte array in little-endian /// byte order. + #[inline] pub fn to_le_bytes(self) -> crate::simd::Simd { let bytes = self.to_ne_bytes(); if cfg!(target_endian = "little") { @@ -38,12 +41,14 @@ macro_rules! impl_to_bytes { /// Create a native endian integer value from its memory representation as a byte array /// in native endianness. + #[inline] pub fn from_ne_bytes(bytes: crate::simd::Simd) -> Self { // Safety: transmuting between vectors is safe unsafe { core::mem::transmute_copy(&bytes) } } /// Create an integer value from its representation as a byte array in big endian. + #[inline] pub fn from_be_bytes(bytes: crate::simd::Simd) -> Self { let bytes = if cfg!(target_endian = "big") { bytes @@ -54,6 +59,7 @@ macro_rules! impl_to_bytes { } /// Create an integer value from its representation as a byte array in little endian. + #[inline] pub fn from_le_bytes(bytes: crate::simd::Simd) -> Self { let bytes = if cfg!(target_endian = "little") { bytes diff --git a/crates/core_simd/src/vendor.rs b/crates/core_simd/src/vendor.rs index 9fb70218c95..6223bedb4e1 100644 --- a/crates/core_simd/src/vendor.rs +++ b/crates/core_simd/src/vendor.rs @@ -21,7 +21,7 @@ macro_rules! from_transmute { #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] mod x86; -#[cfg(any(target_arch = "wasm32"))] +#[cfg(target_arch = "wasm32")] mod wasm32; #[cfg(any(target_arch = "aarch64", target_arch = "arm",))] diff --git a/crates/core_simd/src/vendor/x86.rs b/crates/core_simd/src/vendor/x86.rs index 0dd47015ed2..66aaf90eef5 100644 --- a/crates/core_simd/src/vendor/x86.rs +++ b/crates/core_simd/src/vendor/x86.rs @@ -1,6 +1,6 @@ use crate::simd::*; -#[cfg(any(target_arch = "x86"))] +#[cfg(target_arch = "x86")] use core::arch::x86::*; #[cfg(target_arch = "x86_64")]