From 40142ac034088c0ca149d4ca511bc854c70ff238 Mon Sep 17 00:00:00 2001 From: Caleb Zulawski Date: Sat, 7 Aug 2021 21:15:24 +0000 Subject: [PATCH] Remove aliases --- crates/core_simd/src/select.rs | 16 ++++---- crates/core_simd/src/vector/float.rs | 20 ++++------ crates/core_simd/src/vector/int.rs | 55 ++++++++++------------------ crates/core_simd/src/vector/uint.rs | 55 +++++++++++----------------- crates/core_simd/tests/round.rs | 8 ++-- 5 files changed, 60 insertions(+), 94 deletions(-) diff --git a/crates/core_simd/src/select.rs b/crates/core_simd/src/select.rs index 1f7ea854a93..710d23a71d0 100644 --- a/crates/core_simd/src/select.rs +++ b/crates/core_simd/src/select.rs @@ -60,10 +60,10 @@ impl Mask /// /// ``` /// # #![feature(portable_simd)] - /// # use core_simd::{Mask32, SimdI32}; - /// let a = SimdI32::from_array([0, 1, 2, 3]); - /// let b = SimdI32::from_array([4, 5, 6, 7]); - /// let mask = Mask32::from_array([true, false, false, true]); + /// # use core_simd::{Mask, Simd}; + /// let a = Simd::from_array([0, 1, 2, 3]); + /// let b = Simd::from_array([4, 5, 6, 7]); + /// let mask = Mask::from_array([true, false, false, true]); /// let c = mask.select(a, b); /// assert_eq!(c.to_array(), [0, 5, 6, 3]); /// ``` @@ -71,10 +71,10 @@ impl Mask /// `select` can also be used on masks: /// ``` /// # #![feature(portable_simd)] - /// # use core_simd::Mask32; - /// let a = Mask32::from_array([true, true, false, false]); - /// let b = Mask32::from_array([false, false, true, true]); - /// let mask = Mask32::from_array([true, false, false, true]); + /// # use core_simd::Mask; + /// let a = Mask::::from_array([true, true, false, false]); + /// let b = Mask::::from_array([false, false, true, true]); + /// let mask = Mask::::from_array([true, false, false, true]); /// let c = mask.select(a, b); /// assert_eq!(c.to_array(), [true, false, true, false]); /// ``` diff --git a/crates/core_simd/src/vector/float.rs b/crates/core_simd/src/vector/float.rs index 96aacdfcca1..6ef88ddebc6 100644 --- a/crates/core_simd/src/vector/float.rs +++ b/crates/core_simd/src/vector/float.rs @@ -183,32 +183,26 @@ pub fn clamp(self, min: Self, max: Self) -> Self { }; } -/// A SIMD vector of containing `LANES` `f32` values. -pub type SimdF32 = crate::Simd; - -/// A SIMD vector of containing `LANES` `f64` values. -pub type SimdF64 = crate::Simd; - impl_float_vector! { f32, u32, i32 } impl_float_vector! { f64, u64, i64 } /// Vector of two `f32` values -pub type f32x2 = SimdF32<2>; +pub type f32x2 = Simd; /// Vector of four `f32` values -pub type f32x4 = SimdF32<4>; +pub type f32x4 = Simd; /// Vector of eight `f32` values -pub type f32x8 = SimdF32<8>; +pub type f32x8 = Simd; /// Vector of 16 `f32` values -pub type f32x16 = SimdF32<16>; +pub type f32x16 = Simd; /// Vector of two `f64` values -pub type f64x2 = SimdF64<2>; +pub type f64x2 = Simd; /// Vector of four `f64` values -pub type f64x4 = SimdF64<4>; +pub type f64x4 = Simd; /// Vector of eight `f64` values -pub type f64x8 = SimdF64<8>; +pub type f64x8 = Simd; diff --git a/crates/core_simd/src/vector/int.rs b/crates/core_simd/src/vector/int.rs index 38d90ad62c0..5f435e16b68 100644 --- a/crates/core_simd/src/vector/int.rs +++ b/crates/core_simd/src/vector/int.rs @@ -36,21 +36,6 @@ pub fn signum(self) -> Self { } } -/// A SIMD vector of containing `LANES` `i8` values. -pub type SimdI8 = crate::Simd; - -/// A SIMD vector of containing `LANES` `i16` values. -pub type SimdI16 = crate::Simd; - -/// A SIMD vector of containing `LANES` `i32` values. -pub type SimdI32 = crate::Simd; - -/// A SIMD vector of containing `LANES` `i64` values. -pub type SimdI64 = crate::Simd; - -/// A SIMD vector of containing `LANES` `isize` values. -pub type SimdIsize = crate::Simd; - impl_integer_vector! { isize } impl_integer_vector! { i16 } impl_integer_vector! { i32 } @@ -58,61 +43,61 @@ pub fn signum(self) -> Self { impl_integer_vector! { i8 } /// Vector of two `isize` values -pub type isizex2 = SimdIsize<2>; +pub type isizex2 = Simd; /// Vector of four `isize` values -pub type isizex4 = SimdIsize<4>; +pub type isizex4 = Simd; /// Vector of eight `isize` values -pub type isizex8 = SimdIsize<8>; +pub type isizex8 = Simd; /// Vector of two `i16` values -pub type i16x2 = SimdI16<2>; +pub type i16x2 = Simd; /// Vector of four `i16` values -pub type i16x4 = SimdI16<4>; +pub type i16x4 = Simd; /// Vector of eight `i16` values -pub type i16x8 = SimdI16<8>; +pub type i16x8 = Simd; /// Vector of 16 `i16` values -pub type i16x16 = SimdI16<16>; +pub type i16x16 = Simd; /// Vector of 32 `i16` values -pub type i16x32 = SimdI16<32>; +pub type i16x32 = Simd; /// Vector of two `i32` values -pub type i32x2 = SimdI32<2>; +pub type i32x2 = Simd; /// Vector of four `i32` values -pub type i32x4 = SimdI32<4>; +pub type i32x4 = Simd; /// Vector of eight `i32` values -pub type i32x8 = SimdI32<8>; +pub type i32x8 = Simd; /// Vector of 16 `i32` values -pub type i32x16 = SimdI32<16>; +pub type i32x16 = Simd; /// Vector of two `i64` values -pub type i64x2 = SimdI64<2>; +pub type i64x2 = Simd; /// Vector of four `i64` values -pub type i64x4 = SimdI64<4>; +pub type i64x4 = Simd; /// Vector of eight `i64` values -pub type i64x8 = SimdI64<8>; +pub type i64x8 = Simd; /// Vector of four `i8` values -pub type i8x4 = SimdI8<4>; +pub type i8x4 = Simd; /// Vector of eight `i8` values -pub type i8x8 = SimdI8<8>; +pub type i8x8 = Simd; /// Vector of 16 `i8` values -pub type i8x16 = SimdI8<16>; +pub type i8x16 = Simd; /// Vector of 32 `i8` values -pub type i8x32 = SimdI8<32>; +pub type i8x32 = Simd; /// Vector of 64 `i8` values -pub type i8x64 = SimdI8<64>; +pub type i8x64 = Simd; diff --git a/crates/core_simd/src/vector/uint.rs b/crates/core_simd/src/vector/uint.rs index ba6dab93090..b3dd199a546 100644 --- a/crates/core_simd/src/vector/uint.rs +++ b/crates/core_simd/src/vector/uint.rs @@ -1,76 +1,63 @@ #![allow(non_camel_case_types)] -/// A SIMD vector of containing `LANES` `u8` values. -pub type SimdU8 = crate::Simd; - -/// A SIMD vector of containing `LANES` `u16` values. -pub type SimdU16 = crate::Simd; - -/// A SIMD vector of containing `LANES` `u32` values. -pub type SimdU32 = crate::Simd; - -/// A SIMD vector of containing `LANES` `u64` values. -pub type SimdU64 = crate::Simd; - -/// A SIMD vector of containing `LANES` `usize` values. -pub type SimdUsize = crate::Simd; +use crate::Simd; /// Vector of two `usize` values -pub type usizex2 = SimdUsize<2>; +pub type usizex2 = Simd; /// Vector of four `usize` values -pub type usizex4 = SimdUsize<4>; +pub type usizex4 = Simd; /// Vector of eight `usize` values -pub type usizex8 = SimdUsize<8>; +pub type usizex8 = Simd; /// Vector of two `u16` values -pub type u16x2 = SimdU16<2>; +pub type u16x2 = Simd; /// Vector of four `u16` values -pub type u16x4 = SimdU16<4>; +pub type u16x4 = Simd; /// Vector of eight `u16` values -pub type u16x8 = SimdU16<8>; +pub type u16x8 = Simd; /// Vector of 16 `u16` values -pub type u16x16 = SimdU16<16>; +pub type u16x16 = Simd; /// Vector of 32 `u16` values -pub type u16x32 = SimdU16<32>; +pub type u16x32 = Simd; /// Vector of two `u32` values -pub type u32x2 = SimdU32<2>; +pub type u32x2 = Simd; /// Vector of four `u32` values -pub type u32x4 = SimdU32<4>; +pub type u32x4 = Simd; /// Vector of eight `u32` values -pub type u32x8 = SimdU32<8>; +pub type u32x8 = Simd; /// Vector of 16 `u32` values -pub type u32x16 = SimdU32<16>; +pub type u32x16 = Simd; /// Vector of two `u64` values -pub type u64x2 = SimdU64<2>; +pub type u64x2 = Simd; /// Vector of four `u64` values -pub type u64x4 = SimdU64<4>; +pub type u64x4 = Simd; /// Vector of eight `u64` values -pub type u64x8 = SimdU64<8>; +pub type u64x8 = Simd; /// Vector of four `u8` values -pub type u8x4 = SimdU8<4>; +pub type u8x4 = Simd; /// Vector of eight `u8` values -pub type u8x8 = SimdU8<8>; +pub type u8x8 = Simd; /// Vector of 16 `u8` values -pub type u8x16 = SimdU8<16>; +pub type u8x16 = Simd; /// Vector of 32 `u8` values -pub type u8x32 = SimdU8<32>; +pub type u8x32 = Simd; /// Vector of 64 `u8` values -pub type u8x64 = SimdU8<64>; +pub type u8x64 = Simd; diff --git a/crates/core_simd/tests/round.rs b/crates/core_simd/tests/round.rs index 37044a75112..11d617a6c2c 100644 --- a/crates/core_simd/tests/round.rs +++ b/crates/core_simd/tests/round.rs @@ -1,9 +1,9 @@ #![feature(portable_simd)] macro_rules! float_rounding_test { - { $vector:ident, $scalar:tt, $int_scalar:tt } => { + { $scalar:tt, $int_scalar:tt } => { mod $scalar { - type Vector = core_simd::$vector; + type Vector = core_simd::Simd<$scalar, LANES>; type Scalar = $scalar; type IntScalar = $int_scalar; @@ -88,5 +88,5 @@ fn to_int_unchecked() { } } -float_rounding_test! { SimdF32, f32, i32 } -float_rounding_test! { SimdF64, f64, i64 } +float_rounding_test! { f32, i32 } +float_rounding_test! { f64, i64 }