[−][src]Struct llhd::value::IntValue
An integer value.
Fields
width: usize
The width of the value in bits.
value: BigUint
The value itself.
Methods
impl IntValue
[src]
pub fn zero(width: usize) -> Self
[src]
Create a zero value.
pub fn all_ones(width: usize) -> Self
[src]
Create a value with all bits set to one.
pub fn from_usize(width: usize, value: usize) -> Self
[src]
Create a new integer value from a usize
.
pub fn from_signed(width: usize, value: BigInt) -> Self
[src]
Create a new integer value from a signed BigInt
value.
pub fn from_unsigned(width: usize, value: BigUint) -> Self
[src]
Create a new integer value from an unsigned BigUint
value.
pub fn to_signed(&self) -> BigInt
[src]
Convert the value to a signed BigInt
.
pub fn to_usize(&self) -> usize
[src]
Convert the value to a usize.
pub fn is_zero(&self) -> bool
[src]
Check if the value is zero.
pub fn is_one(&self) -> bool
[src]
Check if the value is one.
pub fn is_all_ones(&self) -> bool
[src]
Check if the value has every bit set to one.
pub fn ty(&self) -> Type
[src]
Get the type of the value.
impl IntValue
[src]
Slicing.
pub fn extract_slice(&self, off: usize, len: usize) -> IntValue
[src]
Extract a slice of bits from the value.
pub fn insert_slice(&mut self, off: usize, len: usize, value: &IntValue)
[src]
Insert a slice of bits into the value.
impl IntValue
[src]
Unary operators.
impl IntValue
[src]
Binary operators.
pub fn add(&self, other: &Self) -> IntValue
[src]
Compute add
.
pub fn sub(&self, other: &Self) -> IntValue
[src]
Compute sub
.
pub fn and(&self, other: &Self) -> IntValue
[src]
Compute and
.
pub fn or(&self, other: &Self) -> IntValue
[src]
Compute or
.
pub fn xor(&self, other: &Self) -> IntValue
[src]
Compute xor
.
pub fn umul(&self, other: &Self) -> IntValue
[src]
Compute umul
.
pub fn udiv(&self, other: &Self) -> IntValue
[src]
Compute udiv
.
pub fn umod(&self, other: &Self) -> IntValue
[src]
Compute umod
.
pub fn urem(&self, other: &Self) -> IntValue
[src]
Compute urem
.
pub fn smul(&self, other: &Self) -> IntValue
[src]
Compute smul
.
pub fn sdiv(&self, other: &Self) -> IntValue
[src]
Compute sdiv
.
pub fn smod(&self, other: &Self) -> IntValue
[src]
Compute smod
.
pub fn srem(&self, other: &Self) -> IntValue
[src]
Compute srem
.
impl IntValue
[src]
Comparisons.
pub fn eq(&self, other: &Self) -> bool
[src]
Compute ==
.
pub fn neq(&self, other: &Self) -> bool
[src]
Compute !=
.
pub fn ult(&self, other: &Self) -> bool
[src]
Compute unsigned <
.
pub fn ugt(&self, other: &Self) -> bool
[src]
Compute unsigned >
.
pub fn ule(&self, other: &Self) -> bool
[src]
Compute unsigned <=
.
pub fn uge(&self, other: &Self) -> bool
[src]
Compute unsigned >=
.
pub fn slt(&self, other: &Self) -> bool
[src]
Compute signed <
.
pub fn sgt(&self, other: &Self) -> bool
[src]
Compute signed >
.
pub fn sle(&self, other: &Self) -> bool
[src]
Compute signed <=
.
pub fn sge(&self, other: &Self) -> bool
[src]
Compute signed >=
.
impl IntValue
[src]
Opcode implementations.
pub fn try_unary_op(op: Opcode, arg: &IntValue) -> Option<IntValue>
[src]
Execute a unary opcode.
pub fn unary_op(op: Opcode, arg: &IntValue) -> IntValue
[src]
Execute a unary opcode.
pub fn try_binary_op(
op: Opcode,
lhs: &IntValue,
rhs: &IntValue
) -> Option<IntValue>
[src]
op: Opcode,
lhs: &IntValue,
rhs: &IntValue
) -> Option<IntValue>
Execute a binary opcode.
pub fn binary_op(op: Opcode, lhs: &IntValue, rhs: &IntValue) -> IntValue
[src]
Execute a binary opcode.
pub fn try_compare_op(
op: Opcode,
lhs: &IntValue,
rhs: &IntValue
) -> Option<IntValue>
[src]
op: Opcode,
lhs: &IntValue,
rhs: &IntValue
) -> Option<IntValue>
Execute a comparison opcode.
pub fn compare_op(op: Opcode, lhs: &IntValue, rhs: &IntValue) -> IntValue
[src]
Execute a comparison opcode.
Trait Implementations
impl From<(usize, usize)> for IntValue
[src]
impl From<(usize, BigInt)> for IntValue
[src]
impl From<(usize, BigUint)> for IntValue
[src]
impl From<IntValue> for Value
[src]
impl Clone for IntValue
[src]
impl Eq for IntValue
[src]
impl Ord for IntValue
[src]
fn cmp(&self, other: &IntValue) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<IntValue> for IntValue
[src]
impl PartialOrd<IntValue> for IntValue
[src]
fn partial_cmp(&self, other: &IntValue) -> Option<Ordering>
[src]
fn lt(&self, other: &IntValue) -> bool
[src]
fn le(&self, other: &IntValue) -> bool
[src]
fn gt(&self, other: &IntValue) -> bool
[src]
fn ge(&self, other: &IntValue) -> bool
[src]
impl Display for IntValue
[src]
impl Debug for IntValue
[src]
impl Hash for IntValue
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl StructuralPartialEq for IntValue
[src]
impl StructuralEq for IntValue
[src]
impl Serialize for IntValue
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for IntValue
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for IntValue
impl Sync for IntValue
impl Unpin for IntValue
impl UnwindSafe for IntValue
impl RefUnwindSafe for IntValue
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,