Struct orzir_core::ApInt
source · pub struct ApInt { /* private fields */ }Expand description
An arbitrary precision integer with signedless semantics.
Implementations§
source§impl ApInt
impl ApInt
sourcepub fn inplace_bitor(&mut self, other: &Self)
pub fn inplace_bitor(&mut self, other: &Self)
Inplace bitwise or operation.
sourcepub fn inplace_bitand(&mut self, other: &Self)
pub fn inplace_bitand(&mut self, other: &Self)
Inplace bitwise and operation.
sourcepub fn inplace_bitxor(&mut self, other: &Self)
pub fn inplace_bitxor(&mut self, other: &Self)
Inplace bitwise xor operation.
sourcepub fn inplace_bitnot(&mut self)
pub fn inplace_bitnot(&mut self)
Inplace bitwise not operation.
sourcepub fn into_signext(self, width: usize) -> Self
pub fn into_signext(self, width: usize) -> Self
Consumes the integer and zero extends it.
sourcepub fn into_zeroext(self, width: usize) -> Self
pub fn into_zeroext(self, width: usize) -> Self
Consumes the integer and zero extends it.
sourcepub fn into_truncated(self, width: usize) -> (Self, Self)
pub fn into_truncated(self, width: usize) -> (Self, Self)
Consumes the integer and truncates it.
sourcepub fn inplace_add(&mut self, rhs: &Self) -> bool
pub fn inplace_add(&mut self, rhs: &Self) -> bool
Inplace addition and return the carry.
sourcepub fn inplace_sub(&mut self, rhs: &Self) -> bool
pub fn inplace_sub(&mut self, rhs: &Self) -> bool
Inplace subtraction and return the borrow.
sourcepub fn inplace_widening_shl(&mut self, shamt: usize)
pub fn inplace_widening_shl(&mut self, shamt: usize)
Inplace shift left and widen the integer.
sourcepub fn inplace_carrying_shl(&mut self, shamt: usize) -> Self
pub fn inplace_carrying_shl(&mut self, shamt: usize) -> Self
Inplace shift left and return the overflow.
sourcepub fn highest_bit(&self) -> bool
pub fn highest_bit(&self) -> bool
Get the highest bit of the integer.
sourcepub fn inplace_neg(&mut self)
pub fn inplace_neg(&mut self)
Inplace negation.
sourcepub fn inplace_abs(&mut self) -> bool
pub fn inplace_abs(&mut self) -> bool
Inplace absolute value and return the sign.
sourcepub fn into_abs(self) -> (Self, bool)
pub fn into_abs(self) -> (Self, bool)
Consumes the integer and return the absolute value and the sign.
sourcepub fn inplace_widening_umul_chunk(&mut self, chunk: u64)
pub fn inplace_widening_umul_chunk(&mut self, chunk: u64)
Inplace widening unsigned multiplication by a chunk.
This operation widen the integer by one chunk width.
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the integer to minimum width.
sourcepub fn into_shrunk(self) -> Self
pub fn into_shrunk(self) -> Self
Consumes the integer and return the shrunk integer.
sourcepub fn inplace_carrying_umul_chunk(&mut self, chunk: u64) -> Self
pub fn inplace_carrying_umul_chunk(&mut self, chunk: u64) -> Self
Inplace carrying unsigned multiplication by a chunk.
sourcepub fn inplace_widening_umul(&mut self, rhs: &Self)
pub fn inplace_widening_umul(&mut self, rhs: &Self)
Inplace widening unsigned multiplication.
sourcepub fn inplace_widening_smul(&mut self, rhs: &Self)
pub fn inplace_widening_smul(&mut self, rhs: &Self)
Inplace widening signed multiplication.
sourcepub fn inplace_carrying_umul(&mut self, rhs: &Self) -> Self
pub fn inplace_carrying_umul(&mut self, rhs: &Self) -> Self
Inplace carrying signed multiplication, return the overflow.
sourcepub fn inplace_carrying_smul(&mut self, rhs: &Self) -> Self
pub fn inplace_carrying_smul(&mut self, rhs: &Self) -> Self
Inplace carrying signed multiplication, return the overflow.
sourcepub fn inplace_lshr(&mut self, shamt: usize) -> Self
pub fn inplace_lshr(&mut self, shamt: usize) -> Self
Inplace logical shift right and return the discarded bits.
sourcepub fn inplace_ashr(&mut self, shamt: usize) -> Self
pub fn inplace_ashr(&mut self, shamt: usize) -> Self
Inplace arithmetic shift right and return the discarded bits.
sourcepub fn inplace_udiv(&mut self, divisor: &Self) -> Self
pub fn inplace_udiv(&mut self, divisor: &Self) -> Self
Unsigned division and return the remainder.
sourcepub fn inplace_sdiv(&mut self, divisor: &Self) -> Self
pub fn inplace_sdiv(&mut self, divisor: &Self) -> Self
Signed division and return the remainder.
Trait Implementations§
source§impl Ord for ApInt
impl Ord for ApInt
source§impl Parse for ApInt
impl Parse for ApInt
type Item = ApInt
fn parse(_: &mut Context, state: &mut ParseState<'_>) -> ParseResult<Self::Item>
source§impl PartialEq for ApInt
impl PartialEq for ApInt
source§impl PartialOrd for ApInt
impl PartialOrd for ApInt
source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Compare two integers as unsigned integers.
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl Print for ApInt
impl Print for ApInt
fn print(&self, _: &Context, state: &mut PrintState) -> PrintResult<()>
impl Eq for ApInt
impl StructuralPartialEq for ApInt
Auto Trait Implementations§
impl Freeze for ApInt
impl RefUnwindSafe for ApInt
impl Send for ApInt
impl Sync for ApInt
impl Unpin for ApInt
impl UnwindSafe for ApInt
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.