Skip to content

Commit 98cd636

Browse files
workingjubileecalebzulawski
authored andcommitted
Add Mask::cast
1 parent af53b5d commit 98cd636

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/core_simd/src/masks.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ where
181181
self.0.to_int()
182182
}
183183

184+
/// Converts the mask to a mask of any other lane size.
185+
#[inline]
186+
#[must_use = "method returns a new mask and does not mutate the original value"]
187+
pub fn cast<U: MaskElement>(self) -> Mask<U, LANES> {
188+
Mask(self.0.convert())
189+
}
190+
184191
/// Tests the value of the specified lane.
185192
///
186193
/// # Safety

0 commit comments

Comments
 (0)