diff --git a/src/compute/comparison/simd/packed.rs b/src/compute/comparison/simd/packed.rs index c36c6d52cd7..9348cbed484 100644 --- a/src/compute/comparison/simd/packed.rs +++ b/src/compute/comparison/simd/packed.rs @@ -1,7 +1,7 @@ use std::convert::TryInto; +use std::simd::ToBitMask; use crate::types::simd::*; - use crate::types::{days_ms, months_days_ns}; use super::*; @@ -29,34 +29,34 @@ macro_rules! simd8 { impl Simd8PartialEq for $md { #[inline] fn eq(self, other: Self) -> u8 { - to_bitmask(self.lanes_eq(other)) + self.lanes_eq(other).to_bitmask() } #[inline] fn neq(self, other: Self) -> u8 { - to_bitmask(self.lanes_ne(other)) + self.lanes_ne(other).to_bitmask() } } impl Simd8PartialOrd for $md { #[inline] fn lt_eq(self, other: Self) -> u8 { - to_bitmask(self.lanes_le(other)) + self.lanes_le(other).to_bitmask() } #[inline] fn lt(self, other: Self) -> u8 { - to_bitmask(self.lanes_lt(other)) + self.lanes_lt(other).to_bitmask() } #[inline] fn gt_eq(self, other: Self) -> u8 { - to_bitmask(self.lanes_ge(other)) + self.lanes_ge(other).to_bitmask() } #[inline] fn gt(self, other: Self) -> u8 { - to_bitmask(self.lanes_gt(other)) + self.lanes_gt(other).to_bitmask() } } }; @@ -77,14 +77,3 @@ simd8_native!(days_ms); simd8_native_partial_eq!(days_ms); simd8_native!(months_days_ns); simd8_native_partial_eq!(months_days_ns); - -fn to_bitmask(mask: std::simd::Mask) -> u8 { - mask.test(0) as u8 - | ((mask.test(1) as u8) << 1) - | ((mask.test(2) as u8) << 2) - | ((mask.test(3) as u8) << 3) - | ((mask.test(4) as u8) << 4) - | ((mask.test(5) as u8) << 5) - | ((mask.test(6) as u8) << 6) - | ((mask.test(7) as u8) << 7) -}