Skip to content

Commit 3f01eee

Browse files
committed
remove the mask input parameter from mask_up_to
1 parent 783ab1b commit 3f01eee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/core_simd/src/vector.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ where
405405
mut enable: Mask<<T as SimdElement>::Mask, N>,
406406
or: Self,
407407
) -> Self {
408-
enable &= mask_up_to(enable, slice.len());
408+
enable &= mask_up_to(slice.len());
409409
// SAFETY: We performed the bounds check by updating the mask. &[T] is properly aligned to
410410
// the element.
411411
unsafe { Self::load_select_ptr(slice.as_ptr(), enable, or) }
@@ -624,7 +624,7 @@ where
624624

625625
#[inline]
626626
pub fn masked_store(self, slice: &mut [T], mut enable: Mask<<T as SimdElement>::Mask, N>) {
627-
enable &= mask_up_to(enable, slice.len());
627+
enable &= mask_up_to(slice.len());
628628
// SAFETY: We performed the bounds check by updating the mask. &[T] is properly aligned to
629629
// the element.
630630
unsafe { self.masked_store_ptr(slice.as_mut_ptr(), enable) }
@@ -1149,12 +1149,12 @@ where
11491149
}
11501150

11511151
#[inline]
1152-
fn mask_up_to<M, const N: usize>(enable: Mask<M, N>, len: usize) -> Mask<M, N>
1152+
fn mask_up_to<M, const N: usize>(len: usize) -> Mask<M, N>
11531153
where
11541154
LaneCount<N>: SupportedLaneCount,
11551155
M: MaskElement,
11561156
{
11571157
let index = lane_indices::<i8, N>();
11581158
let lt = index.simd_lt(Simd::splat(i8::try_from(len).unwrap_or(i8::MAX)));
1159-
enable & Mask::<M, N>::from_bitmask_vector(lt.to_bitmask_vector())
1159+
Mask::<M, N>::from_bitmask_vector(lt.to_bitmask_vector())
11601160
}

0 commit comments

Comments
 (0)