about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCaleb Zulawski <caleb.zulawski@gmail.com>2021-08-07 21:15:24 +0000
committerCaleb Zulawski <caleb.zulawski@gmail.com>2021-08-07 21:15:24 +0000
commit40142ac034088c0ca149d4ca511bc854c70ff238 (patch)
treec9135fa1224da264a245dde7090730c3621ed722
parent275889f7f464614069e88ea8efbf41c560da0a06 (diff)
downloadrust-40142ac034088c0ca149d4ca511bc854c70ff238.tar.gz
rust-40142ac034088c0ca149d4ca511bc854c70ff238.zip
Remove aliases
-rw-r--r--crates/core_simd/src/select.rs16
-rw-r--r--crates/core_simd/src/vector/float.rs20
-rw-r--r--crates/core_simd/src/vector/int.rs55
-rw-r--r--crates/core_simd/src/vector/uint.rs55
-rw-r--r--crates/core_simd/tests/round.rs8
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 @@ where
     ///
     /// ```
     /// # #![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 @@ where
     /// `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::<i32, 4>::from_array([true, true, false, false]);
+    /// let b = Mask::<i32, 4>::from_array([false, false, true, true]);
+    /// let mask = Mask::<i32, 4>::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 @@ macro_rules! impl_float_vector {
     };
 }
 
-/// A SIMD vector of containing `LANES` `f32` values.
-pub type SimdF32<const LANES: usize> = crate::Simd<f32, LANES>;
-
-/// A SIMD vector of containing `LANES` `f64` values.
-pub type SimdF64<const LANES: usize> = crate::Simd<f64, LANES>;
-
 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<f32, 2>;
 
 /// Vector of four `f32` values
-pub type f32x4 = SimdF32<4>;
+pub type f32x4 = Simd<f32, 4>;
 
 /// Vector of eight `f32` values
-pub type f32x8 = SimdF32<8>;
+pub type f32x8 = Simd<f32, 8>;
 
 /// Vector of 16 `f32` values
-pub type f32x16 = SimdF32<16>;
+pub type f32x16 = Simd<f32, 16>;
 
 /// Vector of two `f64` values
-pub type f64x2 = SimdF64<2>;
+pub type f64x2 = Simd<f64, 2>;
 
 /// Vector of four `f64` values
-pub type f64x4 = SimdF64<4>;
+pub type f64x4 = Simd<f64, 4>;
 
 /// Vector of eight `f64` values
-pub type f64x8 = SimdF64<8>;
+pub type f64x8 = Simd<f64, 8>;
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 @@ macro_rules! impl_integer_vector {
     }
 }
 
-/// A SIMD vector of containing `LANES` `i8` values.
-pub type SimdI8<const LANES: usize> = crate::Simd<i8, LANES>;
-
-/// A SIMD vector of containing `LANES` `i16` values.
-pub type SimdI16<const LANES: usize> = crate::Simd<i16, LANES>;
-
-/// A SIMD vector of containing `LANES` `i32` values.
-pub type SimdI32<const LANES: usize> = crate::Simd<i32, LANES>;
-
-/// A SIMD vector of containing `LANES` `i64` values.
-pub type SimdI64<const LANES: usize> = crate::Simd<i64, LANES>;
-
-/// A SIMD vector of containing `LANES` `isize` values.
-pub type SimdIsize<const LANES: usize> = crate::Simd<isize, LANES>;
-
 impl_integer_vector! { isize }
 impl_integer_vector! { i16 }
 impl_integer_vector! { i32 }
@@ -58,61 +43,61 @@ impl_integer_vector! { i64 }
 impl_integer_vector! { i8 }
 
 /// Vector of two `isize` values
-pub type isizex2 = SimdIsize<2>;
+pub type isizex2 = Simd<isize, 2>;
 
 /// Vector of four `isize` values
-pub type isizex4 = SimdIsize<4>;
+pub type isizex4 = Simd<isize, 4>;
 
 /// Vector of eight `isize` values
-pub type isizex8 = SimdIsize<8>;
+pub type isizex8 = Simd<isize, 8>;
 
 /// Vector of two `i16` values
-pub type i16x2 = SimdI16<2>;
+pub type i16x2 = Simd<i16, 2>;
 
 /// Vector of four `i16` values
-pub type i16x4 = SimdI16<4>;
+pub type i16x4 = Simd<i16, 4>;
 
 /// Vector of eight `i16` values
-pub type i16x8 = SimdI16<8>;
+pub type i16x8 = Simd<i16, 8>;
 
 /// Vector of 16 `i16` values
-pub type i16x16 = SimdI16<16>;
+pub type i16x16 = Simd<i16, 16>;
 
 /// Vector of 32 `i16` values
-pub type i16x32 = SimdI16<32>;
+pub type i16x32 = Simd<i16, 32>;
 
 /// Vector of two `i32` values
-pub type i32x2 = SimdI32<2>;
+pub type i32x2 = Simd<i32, 2>;
 
 /// Vector of four `i32` values
-pub type i32x4 = SimdI32<4>;
+pub type i32x4 = Simd<i32, 4>;
 
 /// Vector of eight `i32` values
-pub type i32x8 = SimdI32<8>;
+pub type i32x8 = Simd<i32, 8>;
 
 /// Vector of 16 `i32` values
-pub type i32x16 = SimdI32<16>;
+pub type i32x16 = Simd<i32, 16>;
 
 /// Vector of two `i64` values
-pub type i64x2 = SimdI64<2>;
+pub type i64x2 = Simd<i64, 2>;
 
 /// Vector of four `i64` values
-pub type i64x4 = SimdI64<4>;
+pub type i64x4 = Simd<i64, 4>;
 
 /// Vector of eight `i64` values
-pub type i64x8 = SimdI64<8>;
+pub type i64x8 = Simd<i64, 8>;
 
 /// Vector of four `i8` values
-pub type i8x4 = SimdI8<4>;
+pub type i8x4 = Simd<i8, 4>;
 
 /// Vector of eight `i8` values
-pub type i8x8 = SimdI8<8>;
+pub type i8x8 = Simd<i8, 8>;
 
 /// Vector of 16 `i8` values
-pub type i8x16 = SimdI8<16>;
+pub type i8x16 = Simd<i8, 16>;
 
 /// Vector of 32 `i8` values
-pub type i8x32 = SimdI8<32>;
+pub type i8x32 = Simd<i8, 32>;
 
 /// Vector of 64 `i8` values
-pub type i8x64 = SimdI8<64>;
+pub type i8x64 = Simd<i8, 64>;
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<const LANES: usize> = crate::Simd<u8, LANES>;
-
-/// A SIMD vector of containing `LANES` `u16` values.
-pub type SimdU16<const LANES: usize> = crate::Simd<u16, LANES>;
-
-/// A SIMD vector of containing `LANES` `u32` values.
-pub type SimdU32<const LANES: usize> = crate::Simd<u32, LANES>;
-
-/// A SIMD vector of containing `LANES` `u64` values.
-pub type SimdU64<const LANES: usize> = crate::Simd<u64, LANES>;
-
-/// A SIMD vector of containing `LANES` `usize` values.
-pub type SimdUsize<const LANES: usize> = crate::Simd<usize, LANES>;
+use crate::Simd;
 
 /// Vector of two `usize` values
-pub type usizex2 = SimdUsize<2>;
+pub type usizex2 = Simd<usize, 2>;
 
 /// Vector of four `usize` values
-pub type usizex4 = SimdUsize<4>;
+pub type usizex4 = Simd<usize, 4>;
 
 /// Vector of eight `usize` values
-pub type usizex8 = SimdUsize<8>;
+pub type usizex8 = Simd<usize, 8>;
 
 /// Vector of two `u16` values
-pub type u16x2 = SimdU16<2>;
+pub type u16x2 = Simd<u16, 2>;
 
 /// Vector of four `u16` values
-pub type u16x4 = SimdU16<4>;
+pub type u16x4 = Simd<u16, 4>;
 
 /// Vector of eight `u16` values
-pub type u16x8 = SimdU16<8>;
+pub type u16x8 = Simd<u16, 8>;
 
 /// Vector of 16 `u16` values
-pub type u16x16 = SimdU16<16>;
+pub type u16x16 = Simd<u16, 16>;
 
 /// Vector of 32 `u16` values
-pub type u16x32 = SimdU16<32>;
+pub type u16x32 = Simd<u16, 32>;
 
 /// Vector of two `u32` values
-pub type u32x2 = SimdU32<2>;
+pub type u32x2 = Simd<u32, 2>;
 
 /// Vector of four `u32` values
-pub type u32x4 = SimdU32<4>;
+pub type u32x4 = Simd<u32, 4>;
 
 /// Vector of eight `u32` values
-pub type u32x8 = SimdU32<8>;
+pub type u32x8 = Simd<u32, 8>;
 
 /// Vector of 16 `u32` values
-pub type u32x16 = SimdU32<16>;
+pub type u32x16 = Simd<u32, 16>;
 
 /// Vector of two `u64` values
-pub type u64x2 = SimdU64<2>;
+pub type u64x2 = Simd<u64, 2>;
 
 /// Vector of four `u64` values
-pub type u64x4 = SimdU64<4>;
+pub type u64x4 = Simd<u64, 4>;
 
 /// Vector of eight `u64` values
-pub type u64x8 = SimdU64<8>;
+pub type u64x8 = Simd<u64, 8>;
 
 /// Vector of four `u8` values
-pub type u8x4 = SimdU8<4>;
+pub type u8x4 = Simd<u8, 4>;
 
 /// Vector of eight `u8` values
-pub type u8x8 = SimdU8<8>;
+pub type u8x8 = Simd<u8, 8>;
 
 /// Vector of 16 `u8` values
-pub type u8x16 = SimdU8<16>;
+pub type u8x16 = Simd<u8, 16>;
 
 /// Vector of 32 `u8` values
-pub type u8x32 = SimdU8<32>;
+pub type u8x32 = Simd<u8, 32>;
 
 /// Vector of 64 `u8` values
-pub type u8x64 = SimdU8<64>;
+pub type u8x64 = Simd<u8, 64>;
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<const LANES: usize> = core_simd::$vector<LANES>;
+            type Vector<const LANES: usize> = core_simd::Simd<$scalar, LANES>;
             type Scalar = $scalar;
             type IntScalar = $int_scalar;
 
@@ -88,5 +88,5 @@ macro_rules! float_rounding_test {
     }
 }
 
-float_rounding_test! { SimdF32, f32, i32 }
-float_rounding_test! { SimdF64, f64, i64 }
+float_rounding_test! { f32, i32 }
+float_rounding_test! { f64, i64 }