diff --git a/crates/core_simd/src/iter.rs b/crates/core_simd/src/iter.rs index 0020ea5f201..f403f4d9047 100644 --- a/crates/core_simd/src/iter.rs +++ b/crates/core_simd/src/iter.rs @@ -1,54 +1,58 @@ -use crate::{LaneCount, SupportedLaneCount}; +use crate::{LaneCount, Simd, SupportedLaneCount}; +use core::{ + iter::{Product, Sum}, + ops::{Add, Mul}, +}; macro_rules! impl_traits { - { $type:ident } => { - impl core::iter::Sum for crate::$type + { $type:ty } => { + impl Sum for Simd<$type, LANES> where LaneCount: SupportedLaneCount, { - fn sum>(iter: I) -> Self { - iter.fold(Default::default(), core::ops::Add::add) + fn sum>(iter: I) -> Self { + iter.fold(Simd::splat(0 as $type), Add::add) } } - impl core::iter::Product for crate::$type + impl core::iter::Product for Simd<$type, LANES> where LaneCount: SupportedLaneCount, { - fn product>(iter: I) -> Self { - iter.fold(Default::default(), core::ops::Mul::mul) + fn product>(iter: I) -> Self { + iter.fold(Simd::splat(1 as $type), Mul::mul) } } - impl<'a, const LANES: usize> core::iter::Sum<&'a Self> for crate::$type + impl<'a, const LANES: usize> Sum<&'a Self> for Simd<$type, LANES> where LaneCount: SupportedLaneCount, { - fn sum>(iter: I) -> Self { - iter.fold(Default::default(), core::ops::Add::add) + fn sum>(iter: I) -> Self { + iter.fold(Simd::splat(0 as $type), Add::add) } } - impl<'a, const LANES: usize> core::iter::Product<&'a Self> for crate::$type + impl<'a, const LANES: usize> Product<&'a Self> for Simd<$type, LANES> where LaneCount: SupportedLaneCount, { - fn product>(iter: I) -> Self { - iter.fold(Default::default(), core::ops::Mul::mul) + fn product>(iter: I) -> Self { + iter.fold(Simd::splat(1 as $type), Mul::mul) } } } } -impl_traits! { SimdF32 } -impl_traits! { SimdF64 } -impl_traits! { SimdU8 } -impl_traits! { SimdU16 } -impl_traits! { SimdU32 } -impl_traits! { SimdU64 } -impl_traits! { SimdUsize } -impl_traits! { SimdI8 } -impl_traits! { SimdI16 } -impl_traits! { SimdI32 } -impl_traits! { SimdI64 } -impl_traits! { SimdIsize } +impl_traits! { f32 } +impl_traits! { f64 } +impl_traits! { u8 } +impl_traits! { u16 } +impl_traits! { u32 } +impl_traits! { u64 } +impl_traits! { usize } +impl_traits! { i8 } +impl_traits! { i16 } +impl_traits! { i32 } +impl_traits! { i64 } +impl_traits! { isize } diff --git a/crates/core_simd/src/masks.rs b/crates/core_simd/src/masks.rs index d4a0cff4e23..b7bde44b384 100644 --- a/crates/core_simd/src/masks.rs +++ b/crates/core_simd/src/masks.rs @@ -522,21 +522,21 @@ pub type masksizex4 = MaskSize<4>; pub type masksizex8 = MaskSize<8>; macro_rules! impl_from { - { $from:ident ($from_inner:ident) => $($to:ident ($to_inner:ident)),* } => { + { $from:ty => $($to:ty),* } => { $( - impl From<$from> for $to + impl From> for Mask<$to, LANES> where - crate::LaneCount: crate::SupportedLaneCount, + LaneCount: SupportedLaneCount, { - fn from(value: $from) -> Self { + fn from(value: Mask<$from, LANES>) -> Self { Self(value.0.convert()) } } )* } } -impl_from! { Mask8 (SimdI8) => Mask16 (SimdI16), Mask32 (SimdI32), Mask64 (SimdI64), MaskSize (SimdIsize) } -impl_from! { Mask16 (SimdI16) => Mask32 (SimdI32), Mask64 (SimdI64), MaskSize (SimdIsize), Mask8 (SimdI8) } -impl_from! { Mask32 (SimdI32) => Mask64 (SimdI64), MaskSize (SimdIsize), Mask8 (SimdI8), Mask16 (SimdI16) } -impl_from! { Mask64 (SimdI64) => MaskSize (SimdIsize), Mask8 (SimdI8), Mask16 (SimdI16), Mask32 (SimdI32) } -impl_from! { MaskSize (SimdIsize) => Mask8 (SimdI8), Mask16 (SimdI16), Mask32 (SimdI32), Mask64 (SimdI64) } +impl_from! { i8 => i16, i32, i64, isize } +impl_from! { i16 => i32, i64, isize, i8 } +impl_from! { i32 => i64, isize, i8, i16 } +impl_from! { i64 => isize, i8, i16, i32 } +impl_from! { isize => i8, i16, i32, i64 } diff --git a/crates/core_simd/src/masks/full_masks.rs b/crates/core_simd/src/masks/full_masks.rs index 858c99032a3..b45ace3791d 100644 --- a/crates/core_simd/src/masks/full_masks.rs +++ b/crates/core_simd/src/masks/full_masks.rs @@ -158,6 +158,16 @@ where )) } } + + #[inline] + pub fn any(self) -> bool { + unsafe { crate::intrinsics::simd_reduce_any(self.to_int()) } + } + + #[inline] + pub fn all(self) -> bool { + unsafe { crate::intrinsics::simd_reduce_all(self.to_int()) } + } } impl core::convert::From> for Simd @@ -217,5 +227,3 @@ where Self::splat(true) ^ self } } - -impl_full_mask_reductions! {} diff --git a/crates/core_simd/src/math.rs b/crates/core_simd/src/math.rs index 28720eb13e3..7affecbafd6 100644 --- a/crates/core_simd/src/math.rs +++ b/crates/core_simd/src/math.rs @@ -1,6 +1,8 @@ +use crate::{LaneCount, Simd, SupportedLaneCount}; + macro_rules! impl_uint_arith { - ($(($name:ident, $n:ident)),+) => { - $( impl $name where crate::LaneCount: crate::SupportedLaneCount { + ($($ty:ty),+) => { + $( impl Simd<$ty, LANES> where LaneCount: SupportedLaneCount { /// Lanewise saturating add. /// @@ -8,9 +10,9 @@ macro_rules! impl_uint_arith { /// ``` /// # #![feature(portable_simd)] /// # use core_simd::*; - #[doc = concat!("# use core::", stringify!($n), "::MAX;")] - #[doc = concat!("let x = ", stringify!($name), "::from_array([2, 1, 0, MAX]);")] - #[doc = concat!("let max = ", stringify!($name), "::splat(MAX);")] + #[doc = concat!("# use core::", stringify!($ty), "::MAX;")] + /// let x = Simd::from_array([2, 1, 0, MAX]); + /// let max = Simd::splat(MAX); /// let unsat = x + max; /// let sat = x.saturating_add(max); /// assert_eq!(x - 1, unsat); @@ -27,13 +29,13 @@ macro_rules! impl_uint_arith { /// ``` /// # #![feature(portable_simd)] /// # use core_simd::*; - #[doc = concat!("# use core::", stringify!($n), "::MAX;")] - #[doc = concat!("let x = ", stringify!($name), "::from_array([2, 1, 0, MAX]);")] - #[doc = concat!("let max = ", stringify!($name), "::splat(MAX);")] + #[doc = concat!("# use core::", stringify!($ty), "::MAX;")] + /// let x = Simd::from_array([2, 1, 0, MAX]); + /// let max = Simd::splat(MAX); /// let unsat = x - max; /// let sat = x.saturating_sub(max); /// assert_eq!(unsat, x + 1); - #[doc = concat!("assert_eq!(sat, ", stringify!($name), "::splat(0));")] + /// assert_eq!(sat, Simd::splat(0)); #[inline] pub fn saturating_sub(self, second: Self) -> Self { unsafe { crate::intrinsics::simd_saturating_sub(self, second) } @@ -43,8 +45,8 @@ macro_rules! impl_uint_arith { } macro_rules! impl_int_arith { - ($(($name:ident, $n:ident)),+) => { - $( impl $name where crate::LaneCount: crate::SupportedLaneCount { + ($($ty:ty),+) => { + $( impl Simd<$ty, LANES> where LaneCount: SupportedLaneCount { /// Lanewise saturating add. /// @@ -52,13 +54,13 @@ macro_rules! impl_int_arith { /// ``` /// # #![feature(portable_simd)] /// # use core_simd::*; - #[doc = concat!("# use core::", stringify!($n), "::{MIN, MAX};")] - #[doc = concat!("let x = ", stringify!($name), "::from_array([MIN, 0, 1, MAX]);")] - #[doc = concat!("let max = ", stringify!($name), "::splat(MAX);")] + #[doc = concat!("# use core::", stringify!($ty), "::{MIN, MAX};")] + /// let x = Simd::from_array([MIN, 0, 1, MAX]); + /// let max = Simd::splat(MAX); /// let unsat = x + max; /// let sat = x.saturating_add(max); - #[doc = concat!("assert_eq!(unsat, ", stringify!($name), "::from_array([-1, MAX, MIN, -2]));")] - #[doc = concat!("assert_eq!(sat, ", stringify!($name), "::from_array([-1, MAX, MAX, MAX]));")] + /// assert_eq!(unsat, Simd::from_array([-1, MAX, MIN, -2])); + /// assert_eq!(sat, Simd::from_array([-1, MAX, MAX, MAX])); /// ``` #[inline] pub fn saturating_add(self, second: Self) -> Self { @@ -71,13 +73,13 @@ macro_rules! impl_int_arith { /// ``` /// # #![feature(portable_simd)] /// # use core_simd::*; - #[doc = concat!("# use core::", stringify!($n), "::{MIN, MAX};")] - #[doc = concat!("let x = ", stringify!($name), "::from_array([MIN, -2, -1, MAX]);")] - #[doc = concat!("let max = ", stringify!($name), "::splat(MAX);")] + #[doc = concat!("# use core::", stringify!($ty), "::{MIN, MAX};")] + /// let x = Simd::from_array([MIN, -2, -1, MAX]); + /// let max = Simd::splat(MAX); /// let unsat = x - max; /// let sat = x.saturating_sub(max); - #[doc = concat!("assert_eq!(unsat, ", stringify!($name), "::from_array([1, MAX, MIN, 0]));")] - #[doc = concat!("assert_eq!(sat, ", stringify!($name), "::from_array([MIN, MIN, MIN, 0]));")] + /// assert_eq!(unsat, Simd::from_array([1, MAX, MIN, 0])); + /// assert_eq!(sat, Simd::from_array([MIN, MIN, MIN, 0])); #[inline] pub fn saturating_sub(self, second: Self) -> Self { unsafe { crate::intrinsics::simd_saturating_sub(self, second) } @@ -90,13 +92,13 @@ macro_rules! impl_int_arith { /// ``` /// # #![feature(portable_simd)] /// # use core_simd::*; - #[doc = concat!("# use core::", stringify!($n), "::{MIN, MAX};")] - #[doc = concat!("let xs = ", stringify!($name), "::from_array([MIN, MIN +1, -5, 0]);")] - #[doc = concat!("assert_eq!(xs.abs(), ", stringify!($name), "::from_array([MIN, MAX, 5, 0]));")] + #[doc = concat!("# use core::", stringify!($ty), "::{MIN, MAX};")] + /// let xs = Simd::from_array([MIN, MIN +1, -5, 0]); + /// assert_eq!(xs.abs(), Simd::from_array([MIN, MAX, 5, 0])); /// ``` #[inline] pub fn abs(self) -> Self { - const SHR: $n = <$n>::BITS as $n - 1; + const SHR: $ty = <$ty>::BITS as $ty - 1; let m = self >> SHR; (self^m) - m } @@ -108,17 +110,17 @@ macro_rules! impl_int_arith { /// ``` /// # #![feature(portable_simd)] /// # use core_simd::*; - #[doc = concat!("# use core::", stringify!($n), "::{MIN, MAX};")] - #[doc = concat!("let xs = ", stringify!($name), "::from_array([MIN, -2, 0, 3]);")] + #[doc = concat!("# use core::", stringify!($ty), "::{MIN, MAX};")] + /// let xs = Simd::from_array([MIN, -2, 0, 3]); /// let unsat = xs.abs(); /// let sat = xs.saturating_abs(); - #[doc = concat!("assert_eq!(unsat, ", stringify!($name), "::from_array([MIN, 2, 0, 3]));")] - #[doc = concat!("assert_eq!(sat, ", stringify!($name), "::from_array([MAX, 2, 0, 3]));")] + /// assert_eq!(unsat, Simd::from_array([MIN, 2, 0, 3])); + /// assert_eq!(sat, Simd::from_array([MAX, 2, 0, 3])); /// ``` #[inline] pub fn saturating_abs(self) -> Self { // arith shift for -1 or 0 mask based on sign bit, giving 2s complement - const SHR: $n = <$n>::BITS as $n - 1; + const SHR: $ty = <$ty>::BITS as $ty - 1; let m = self >> SHR; (self^m).saturating_sub(m) } @@ -130,12 +132,12 @@ macro_rules! impl_int_arith { /// ``` /// # #![feature(portable_simd)] /// # use core_simd::*; - #[doc = concat!("# use core::", stringify!($n), "::{MIN, MAX};")] - #[doc = concat!("let x = ", stringify!($name), "::from_array([MIN, -2, 3, MAX]);")] + #[doc = concat!("# use core::", stringify!($ty), "::{MIN, MAX};")] + /// let x = Simd::from_array([MIN, -2, 3, MAX]); /// let unsat = -x; /// let sat = x.saturating_neg(); - #[doc = concat!("assert_eq!(unsat, ", stringify!($name), "::from_array([MIN, 2, -3, MIN + 1]));")] - #[doc = concat!("assert_eq!(sat, ", stringify!($name), "::from_array([MAX, 2, -3, MIN + 1]));")] + /// assert_eq!(unsat, Simd::from_array([MIN, 2, -3, MIN + 1])); + /// assert_eq!(sat, Simd::from_array([MAX, 2, -3, MIN + 1])); /// ``` #[inline] pub fn saturating_neg(self) -> Self { @@ -145,7 +147,5 @@ macro_rules! impl_int_arith { } } -use crate::vector::*; - -impl_uint_arith! { (SimdU8, u8), (SimdU16, u16), (SimdU32, u32), (SimdU64, u64), (SimdUsize, usize) } -impl_int_arith! { (SimdI8, i8), (SimdI16, i16), (SimdI32, i32), (SimdI64, i64), (SimdIsize, isize) } +impl_uint_arith! { u8, u16, u32, u64, usize } +impl_int_arith! { i8, i16, i32, i64, isize } diff --git a/crates/core_simd/src/reduction.rs b/crates/core_simd/src/reduction.rs index b9c24d027b6..943d2856e35 100644 --- a/crates/core_simd/src/reduction.rs +++ b/crates/core_simd/src/reduction.rs @@ -1,8 +1,10 @@ +use crate::{LaneCount, Simd, SupportedLaneCount}; + macro_rules! impl_integer_reductions { - { $name:ident, $scalar:ty } => { - impl crate::$name + { $scalar:ty } => { + impl Simd<$scalar, LANES> where - crate::LaneCount: crate::SupportedLaneCount, + LaneCount: SupportedLaneCount, { /// Horizontal wrapping add. Returns the sum of the lanes of the vector, with wrapping addition. #[inline] @@ -52,11 +54,22 @@ macro_rules! impl_integer_reductions { } } +impl_integer_reductions! { i8 } +impl_integer_reductions! { i16 } +impl_integer_reductions! { i32 } +impl_integer_reductions! { i64 } +impl_integer_reductions! { isize } +impl_integer_reductions! { u8 } +impl_integer_reductions! { u16 } +impl_integer_reductions! { u32 } +impl_integer_reductions! { u64 } +impl_integer_reductions! { usize } + macro_rules! impl_float_reductions { - { $name:ident, $scalar:ty } => { - impl crate::$name + { $scalar:ty } => { + impl Simd<$scalar, LANES> where - crate::LaneCount: crate::SupportedLaneCount, + LaneCount: SupportedLaneCount, { /// Horizontal add. Returns the sum of the lanes of the vector. @@ -102,22 +115,5 @@ macro_rules! impl_float_reductions { } } -macro_rules! impl_full_mask_reductions { - {} => { - impl Mask - where - Element: MaskElement, - LaneCount: SupportedLaneCount, - { - #[inline] - pub fn any(self) -> bool { - unsafe { crate::intrinsics::simd_reduce_any(self.to_int()) } - } - - #[inline] - pub fn all(self) -> bool { - unsafe { crate::intrinsics::simd_reduce_all(self.to_int()) } - } - } - } -} +impl_float_reductions! { f32 } +impl_float_reductions! { f64 } diff --git a/crates/core_simd/src/round.rs b/crates/core_simd/src/round.rs index c284ade463f..96d46b9a123 100644 --- a/crates/core_simd/src/round.rs +++ b/crates/core_simd/src/round.rs @@ -1,11 +1,13 @@ +use crate::{LaneCount, Simd, SupportedLaneCount}; + macro_rules! implement { { - $type:ident, $int_type:ident + $type:ty, $int_type:ty } => { #[cfg(feature = "std")] - impl crate::$type + impl Simd<$type, LANES> where - crate::LaneCount: crate::SupportedLaneCount, + LaneCount: SupportedLaneCount, { /// Returns the smallest integer greater than or equal to each lane. #[must_use = "method returns a new vector and does not mutate the original value"] @@ -43,9 +45,9 @@ macro_rules! implement { } } - impl crate::$type + impl Simd<$type, LANES> where - crate::LaneCount: crate::SupportedLaneCount, + LaneCount: SupportedLaneCount, { /// Rounds toward zero and converts to the same-width integer type, assuming that /// the value is finite and fits in that type. @@ -57,19 +59,19 @@ macro_rules! implement { /// * Not be infinite /// * Be representable in the return type, after truncating off its fractional part #[inline] - pub unsafe fn to_int_unchecked(self) -> crate::$int_type { + pub unsafe fn to_int_unchecked(self) -> Simd<$int_type, LANES> { crate::intrinsics::simd_cast(self) } /// Creates a floating-point vector from an integer vector. Rounds values that are /// not exactly representable. #[inline] - pub fn round_from_int(value: crate::$int_type) -> Self { + pub fn round_from_int(value: Simd<$int_type, LANES>) -> Self { unsafe { crate::intrinsics::simd_cast(value) } } } } } -implement! { SimdF32, SimdI32 } -implement! { SimdF64, SimdI64 } +implement! { f32, i32 } +implement! { f64, i64 } diff --git a/crates/core_simd/src/to_bytes.rs b/crates/core_simd/src/to_bytes.rs index 31d7dfebe1a..bd818f53211 100644 --- a/crates/core_simd/src/to_bytes.rs +++ b/crates/core_simd/src/to_bytes.rs @@ -1,39 +1,39 @@ macro_rules! impl_to_bytes { - { $name:ident, $size:literal } => { - impl crate::$name + { $ty:ty, $size:literal } => { + impl crate::Simd<$ty, LANES> where crate::LaneCount: crate::SupportedLaneCount, crate::LaneCount<{{ $size * LANES }}>: crate::SupportedLaneCount, { /// Return the memory representation of this integer as a byte array in native byte /// order. - pub fn to_ne_bytes(self) -> crate::SimdU8<{{ $size * LANES }}> { + pub fn to_ne_bytes(self) -> crate::Simd { unsafe { core::mem::transmute_copy(&self) } } /// Create a native endian integer value from its memory representation as a byte array /// in native endianness. - pub fn from_ne_bytes(bytes: crate::SimdU8<{{ $size * LANES }}>) -> Self { + pub fn from_ne_bytes(bytes: crate::Simd) -> Self { unsafe { core::mem::transmute_copy(&bytes) } } } } } -impl_to_bytes! { SimdU8, 1 } -impl_to_bytes! { SimdU16, 2 } -impl_to_bytes! { SimdU32, 4 } -impl_to_bytes! { SimdU64, 8 } +impl_to_bytes! { u8, 1 } +impl_to_bytes! { u16, 2 } +impl_to_bytes! { u32, 4 } +impl_to_bytes! { u64, 8 } #[cfg(target_pointer_width = "32")] -impl_to_bytes! { SimdUsize, 4 } +impl_to_bytes! { usize, 4 } #[cfg(target_pointer_width = "64")] -impl_to_bytes! { SimdUsize, 8 } +impl_to_bytes! { usize, 8 } -impl_to_bytes! { SimdI8, 1 } -impl_to_bytes! { SimdI16, 2 } -impl_to_bytes! { SimdI32, 4 } -impl_to_bytes! { SimdI64, 8 } +impl_to_bytes! { i8, 1 } +impl_to_bytes! { i16, 2 } +impl_to_bytes! { i32, 4 } +impl_to_bytes! { i64, 8 } #[cfg(target_pointer_width = "32")] -impl_to_bytes! { SimdIsize, 4 } +impl_to_bytes! { isize, 4 } #[cfg(target_pointer_width = "64")] -impl_to_bytes! { SimdIsize, 8 } +impl_to_bytes! { isize, 8 } diff --git a/crates/core_simd/src/vector/float.rs b/crates/core_simd/src/vector/float.rs index 40959d66872..840ad049d2e 100644 --- a/crates/core_simd/src/vector/float.rs +++ b/crates/core_simd/src/vector/float.rs @@ -7,8 +7,6 @@ use crate::{LaneCount, SupportedLaneCount}; /// representation. Called from `define_float_vector!`. macro_rules! impl_float_vector { { $name:ident, $type:ident, $bits_ty:ident, $mask_ty:ident, $mask_impl_ty:ident } => { - impl_float_reductions! { $name, $type } - impl $name where LaneCount: SupportedLaneCount, diff --git a/crates/core_simd/src/vector/int.rs b/crates/core_simd/src/vector/int.rs index 74c4a0f2fb6..3dad2abbe7c 100644 --- a/crates/core_simd/src/vector/int.rs +++ b/crates/core_simd/src/vector/int.rs @@ -5,8 +5,6 @@ use crate::{LaneCount, SupportedLaneCount}; /// Implements additional integer traits (Eq, Ord, Hash) on the specified vector `$name`, holding multiple `$lanes` of `$type`. macro_rules! impl_integer_vector { { $name:ident, $type:ty, $mask_ty:ident, $mask_impl_ty:ident } => { - impl_integer_reductions! { $name, $type } - impl $name where LaneCount: SupportedLaneCount, diff --git a/crates/core_simd/src/vector/uint.rs b/crates/core_simd/src/vector/uint.rs index 6dfcbe79593..ba6dab93090 100644 --- a/crates/core_simd/src/vector/uint.rs +++ b/crates/core_simd/src/vector/uint.rs @@ -1,12 +1,5 @@ #![allow(non_camel_case_types)] -/// Implements additional integer traits (Eq, Ord, Hash) on the specified vector `$name`, holding multiple `$lanes` of `$type`. -macro_rules! impl_unsigned_vector { - { $name:ident, $type:ty } => { - impl_integer_reductions! { $name, $type } - } -} - /// A SIMD vector of containing `LANES` `u8` values. pub type SimdU8 = crate::Simd; @@ -22,12 +15,6 @@ pub type SimdU64 = crate::Simd; /// A SIMD vector of containing `LANES` `usize` values. pub type SimdUsize = crate::Simd; -impl_unsigned_vector! { SimdUsize, usize } -impl_unsigned_vector! { SimdU16, u16 } -impl_unsigned_vector! { SimdU32, u32 } -impl_unsigned_vector! { SimdU64, u64 } -impl_unsigned_vector! { SimdU8, u8 } - /// Vector of two `usize` values pub type usizex2 = SimdUsize<2>; diff --git a/crates/core_simd/src/vendor/arm.rs b/crates/core_simd/src/vendor/arm.rs index 1a1e9bed1e1..e39173a9c3c 100644 --- a/crates/core_simd/src/vendor/arm.rs +++ b/crates/core_simd/src/vendor/arm.rs @@ -28,26 +28,26 @@ from_transmute! { unsafe u32x4 => uint32x4_t } from_transmute! { unsafe i32x2 => int32x2_t } from_transmute! { unsafe i32x4 => int32x4_t } -from_transmute! { unsafe SimdU64<1> => uint64x1_t } +from_transmute! { unsafe Simd => uint64x1_t } from_transmute! { unsafe u64x2 => uint64x2_t } -from_transmute! { unsafe SimdI64<1> => int64x1_t } +from_transmute! { unsafe Simd => int64x1_t } from_transmute! { unsafe i64x2 => int64x2_t } -from_transmute! { unsafe SimdU64<1> => poly64x1_t } +from_transmute! { unsafe Simd => poly64x1_t } from_transmute! { unsafe u64x2 => poly64x2_t } #[cfg(target_arch = "arm")] mod arm { use super::*; - from_transmute! { unsafe SimdU8<4> => uint8x4_t } - from_transmute! { unsafe SimdI8<4> => int8x4_t } + from_transmute! { unsafe Simd => uint8x4_t } + from_transmute! { unsafe Simd => int8x4_t } - from_transmute! { unsafe SimdU16<2> => uint16x2_t } - from_transmute! { unsafe SimdI16<2> => int16x2_t } + from_transmute! { unsafe Simd => uint16x2_t } + from_transmute! { unsafe Simd => int16x2_t } } #[cfg(target_arch = "aarch64")] mod aarch64 { use super::*; - from_transmute! { unsafe SimdF64<1> => float64x1_t } + from_transmute! { unsafe Simd => float64x1_t } from_transmute! { unsafe f64x2 => float64x2_t } } diff --git a/crates/core_simd/src/vendor/x86.rs b/crates/core_simd/src/vendor/x86.rs index 4de57de057e..0090c375648 100644 --- a/crates/core_simd/src/vendor/x86.rs +++ b/crates/core_simd/src/vendor/x86.rs @@ -45,10 +45,10 @@ mod p32 { use super::*; from_transmute! { unsafe usizex4 => __m128i } from_transmute! { unsafe usizex8 => __m256i } - from_transmute! { unsafe SimdUsize<16> => __m512i } + from_transmute! { unsafe Simd => __m512i } from_transmute! { unsafe isizex4 => __m128i } from_transmute! { unsafe isizex8 => __m256i } - from_transmute! { unsafe SimdIsize<16> => __m512i } + from_transmute! { unsafe Simd => __m512i } } #[cfg(target_pointer_width = "64")]