X-Git-Url: https://git.libre-soc.org/?p=vector-math.git;a=blobdiff_plain;f=src%2Fstdsimd.rs;h=35692c9246c2bd562cd007ddde475f90f8ce4682;hp=3d757cc21b7a0dee350115ecd9e282f53174d98a;hb=8a170330691c442c16cf6a7c6606fc19493e9e81;hpb=44ef5b89a4a4475f35891c1eb96c463fff6d1721 diff --git a/src/stdsimd.rs b/src/stdsimd.rs index 3d757cc..35692c9 100644 --- a/src/stdsimd.rs +++ b/src/stdsimd.rs @@ -520,7 +520,7 @@ macro_rules! impl_int_scalar { } macro_rules! impl_int_vector { - ($ty:ident) => { + ($ty:ident, $count_leading_zeros:ident, $count_trailing_zeros:ident, $count_ones:ident) => { impl Int for Wrapper<$ty, LANES> where SimdI8: LanesAtMost32, @@ -539,27 +539,15 @@ macro_rules! impl_int_vector { Mask64: Mask, { fn leading_zeros(self) -> Self { - todo!() + crate::algorithms::integer::$count_leading_zeros(self.ctx(), self) } fn trailing_zeros(self) -> Self { - todo!() + crate::algorithms::integer::$count_trailing_zeros(self.ctx(), self) } fn count_ones(self) -> Self { - todo!() - } - - fn leading_ones(self) -> Self { - todo!() - } - - fn trailing_ones(self) -> Self { - todo!() - } - - fn count_zeros(self) -> Self { - todo!() + crate::algorithms::integer::$count_ones(self.ctx(), self) } } }; @@ -567,8 +555,18 @@ macro_rules! impl_int_vector { macro_rules! impl_uint_sint_vector { ($uint:ident, $sint:ident) => { - impl_int_vector!($uint); - impl_int_vector!($sint); + impl_int_vector!( + $uint, + count_leading_zeros_uint, + count_trailing_zeros_uint, + count_ones_uint + ); + impl_int_vector!( + $sint, + count_leading_zeros_sint, + count_trailing_zeros_sint, + count_ones_sint + ); impl UInt for Wrapper<$uint, LANES> where SimdI8: LanesAtMost32,