diff --git a/simd/src/scalar/mod.rs b/simd/src/scalar/mod.rs index 7813cd02..601d70d0 100644 --- a/simd/src/scalar/mod.rs +++ b/simd/src/scalar/mod.rs @@ -10,7 +10,7 @@ use std::f32; use std::fmt::{self, Debug, Formatter}; -use std::ops::{Add, BitAnd, BitOr, Div, Index, IndexMut, Mul, Shr, Sub}; +use std::ops::{Add, BitAnd, BitOr, Div, Index, IndexMut, Mul, Shr, Sub, Not}; mod swizzle_f32x4; mod swizzle_i32x4; @@ -840,6 +840,31 @@ impl U32x2 { pub fn to_i32x2(self) -> I32x2 { I32x2::new(self[0] as i32, self[1] as i32) } + +} + +impl BitAnd for U32x2 { + type Output = U32x2; + #[inline] + fn bitand(self, other: U32x2) -> U32x2 { + U32x2([self[0] & other[0], self[1] & other[1]]) + } +} + +impl BitOr for U32x2 { + type Output = U32x2; + #[inline] + fn bitor(self, other: U32x2) -> U32x2 { + U32x2([self[0] | other[0], self[1] | other[1]]) + } +} + +impl Not for U32x2 { + type Output = U32x2; + #[inline] + fn not(self) -> U32x2 { + U32x2([!self[0], !self[1]]) + } } impl Index for U32x2 {