]> git.lizzy.rs Git - rust.git/blobdiff - crates/core_simd/src/reduction.rs
Begin reducing mask API
[rust.git] / crates / core_simd / src / reduction.rs
index 382d366dd3d1494a0e035775d4db4739c6c84470..2d4f1bca2647009f8dde8eab750bd52f4ec13bbe 100644 (file)
@@ -103,18 +103,16 @@ pub fn horizontal_min(self) -> $scalar {
 }
 
 macro_rules! impl_full_mask_reductions {
-    { $name:ident, $inner:ident } => {
-        impl<const LANES: usize> crate::$name<LANES>
+    { $name:ident, $bits_ty:ident } => {
+        impl<const LANES: usize> $name<LANES>
         where
-            crate::$inner<LANES>: crate::LanesAtMost32
+            crate::$bits_ty<LANES>: crate::LanesAtMost32
         {
-            /// Returns true if any lane is set, or false otherwise.
             #[inline]
             pub fn any(self) -> bool {
                 unsafe { crate::intrinsics::simd_reduce_any(self.to_int()) }
             }
 
-            /// Returns true if all lanes are set, or false otherwise.
             #[inline]
             pub fn all(self) -> bool {
                 unsafe { crate::intrinsics::simd_reduce_all(self.to_int()) }
@@ -124,10 +122,10 @@ pub fn all(self) -> bool {
 }
 
 macro_rules! impl_opaque_mask_reductions {
-    { $name:ident, $inner:ident, $bits_ty:ident } => {
+    { $name:ident, $bits_ty:ident } => {
         impl<const LANES: usize> $name<LANES>
         where
-            $bits_ty<LANES>: crate::LanesAtMost32
+            crate::$bits_ty<LANES>: crate::LanesAtMost32
         {
             /// Returns true if any lane is set, or false otherwise.
             #[inline]
@@ -143,20 +141,3 @@ pub fn all(self) -> bool {
         }
     }
 }
-
-impl<const LANES: usize> crate::BitMask<LANES>
-where
-    crate::BitMask<LANES>: crate::LanesAtMost32,
-{
-    /// Returns true if any lane is set, or false otherwise.
-    #[inline]
-    pub fn any(self) -> bool {
-        self != Self::splat(false)
-    }
-
-    /// Returns true if all lanes are set, or false otherwise.
-    #[inline]
-    pub fn all(self) -> bool {
-        self == Self::splat(true)
-    }
-}