diff --git a/crates/core_simd/src/swizzle.rs b/crates/core_simd/src/swizzle.rs index 3b552016cb5..dbd84543064 100644 --- a/crates/core_simd/src/swizzle.rs +++ b/crates/core_simd/src/swizzle.rs @@ -499,18 +499,30 @@ where /// `padding` from the right. #[inline] #[must_use = "method returns a new mask and does not mutate the original inputs"] - pub fn shift_elements_left(self, padding: T) -> Self { + pub fn shift_elements_left(self, padding: bool) -> Self { // Safety: swizzles are safe for masks - unsafe { Self::from_int_unchecked(self.to_int().shift_elements_left::(padding)) } + unsafe { + Self::from_int_unchecked(self.to_int().shift_elements_left::(if padding { + T::TRUE + } else { + T::FALSE + })) + } } /// Shifts the mask elements to the right by `OFFSET`, filling in with /// `padding` from the left. #[inline] #[must_use = "method returns a new mask and does not mutate the original inputs"] - pub fn shift_elements_right(self, padding: T) -> Self { + pub fn shift_elements_right(self, padding: bool) -> Self { // Safety: swizzles are safe for masks - unsafe { Self::from_int_unchecked(self.to_int().shift_elements_right::(padding)) } + unsafe { + Self::from_int_unchecked(self.to_int().shift_elements_right::(if padding { + T::TRUE + } else { + T::FALSE + })) + } } /// Interleave two masks.