pub enum UnaryOp {
Ident,
ToTwoState,
Minus,
BitNot,
LogicNot,
And,
Or,
Xor,
PopCount,
CountLeadingZeros,
CountTrailingZeros,
}Variants§
Ident
ToTwoState
Convert a four-state value to two-state form. Unknown bits become zero:
(value, mask) -> (value & !mask, 0).
Minus
BitNot
LogicNot
And
Or
Xor
PopCount
CountLeadingZeros
CountTrailingZeros
Implementations§
Source§impl UnaryOp
impl UnaryOp
Sourcepub fn result_width(self, operand_width: usize) -> usize
pub fn result_width(self, operand_width: usize) -> usize
Return the canonical result width for an operand of operand_width bits.
Bit-count operations return a value in 0..=operand_width, which needs
ceil(log2(operand_width + 1)) bits. Computing that as the bit length
of operand_width avoids overflowing when the operand width is
usize::MAX.
Trait Implementations§
impl Copy for UnaryOp
Source§impl<'de> Deserialize<'de> for UnaryOp
impl<'de> Deserialize<'de> for UnaryOp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for UnaryOp
impl StructuralPartialEq for UnaryOp
Auto Trait Implementations§
impl Freeze for UnaryOp
impl RefUnwindSafe for UnaryOp
impl Send for UnaryOp
impl Sync for UnaryOp
impl Unpin for UnaryOp
impl UnsafeUnpin for UnaryOp
impl UnwindSafe for UnaryOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more