[][src]Enum moore_svlog::mir::RvalueKind

pub enum RvalueKind<'a> {
    CastValueDomain {
        from: Domain,
        to: Domain,
        value: &'a Rvalue<'a>,
    },
    CastVectorToAtom {
        domain: Domain,
        value: &'a Rvalue<'a>,
    },
    CastAtomToVector {
        domain: Domain,
        value: &'a Rvalue<'a>,
    },
    CastSign(Sign, &'a Rvalue<'a>),
    CastToBool(&'a Rvalue<'a>),
    Truncate(usize, &'a Rvalue<'a>),
    ZeroExtend(usize, &'a Rvalue<'a>),
    SignExtend(usize, &'a Rvalue<'a>),
    ConstructArray(HashMap<usize, &'a Rvalue<'a>>),
    ConstructStruct(Vec<&'a Rvalue<'a>>),
    Const(Value<'a>),
    UnaryBitwise {
        op: UnaryBitwiseOp,
        arg: &'a Rvalue<'a>,
    },
    BinaryBitwise {
        op: BinaryBitwiseOp,
        lhs: &'a Rvalue<'a>,
        rhs: &'a Rvalue<'a>,
    },
    IntUnaryArith {
        op: IntUnaryArithOp,
        sign: Sign,
        domain: Domain,
        arg: &'a Rvalue<'a>,
    },
    IntBinaryArith {
        op: IntBinaryArithOp,
        sign: Sign,
        domain: Domain,
        lhs: &'a Rvalue<'a>,
        rhs: &'a Rvalue<'a>,
    },
    IntComp {
        op: IntCompOp,
        sign: Sign,
        domain: Domain,
        lhs: &'a Rvalue<'a>,
        rhs: &'a Rvalue<'a>,
    },
    Concat(Vec<&'a Rvalue<'a>>),
    Repeat(usize, &'a Rvalue<'a>),
    Var(NodeId),
    Port(NodeId),
    Index {
        value: &'a Rvalue<'a>,
        base: &'a Rvalue<'a>,
        length: usize,
    },
    Member {
        value: &'a Rvalue<'a>,
        field: usize,
    },
    Ternary {
        cond: &'a Rvalue<'a>,
        true_value: &'a Rvalue<'a>,
        false_value: &'a Rvalue<'a>,
    },
    Shift {
        op: ShiftOp,
        arith: bool,
        value: &'a Rvalue<'a>,
        amount: &'a Rvalue<'a>,
    },
    Reduction {
        op: BinaryBitwiseOp,
        arg: &'a Rvalue<'a>,
    },
    Assignment {
        lvalue: &'a Lvalue<'a>,
        rvalue: &'a Rvalue<'a>,
        result: &'a Rvalue<'a>,
    },
    Error,
}

The different forms an rvalue expression may take.

Variants

CastValueDomain

A cast from a four-valued type to a two-valued type, or vice versa. E.g. integer to int, or int to integer.

Fields of CastValueDomain

from: Domainto: Domainvalue: &'a Rvalue<'a>
CastVectorToAtom

A cast from a single-element vector type to an atom type. E.g. bit [0:0] to bit.

Fields of CastVectorToAtom

domain: Domainvalue: &'a Rvalue<'a>
CastAtomToVector

A cast from an atom type to a single-element vector type. E.g. bit to bit [0:0].

Fields of CastAtomToVector

domain: Domainvalue: &'a Rvalue<'a>
CastSign(Sign, &'a Rvalue<'a>)

A cast from one sign to another. E.g. logic signed to logic unsigned.

CastToBool(&'a Rvalue<'a>)

A cast from a simple bit type to a boolean.

Truncate(usize, &'a Rvalue<'a>)

Shrink the width of a vector type. E.g. bit [31:0] to bit [7:0].

ZeroExtend(usize, &'a Rvalue<'a>)

Increase the width of a vector by zero extension. E.g. bit [7:0] to bit [31:0].

SignExtend(usize, &'a Rvalue<'a>)

Increase the width of a vector by sign extension. E.g. bit signed [7:0] to bit signed [31:0].

ConstructArray(HashMap<usize, &'a Rvalue<'a>>)

Constructor for an array.

ConstructStruct(Vec<&'a Rvalue<'a>>)

Constructor for a struct.

Const(Value<'a>)

A constant value.

UnaryBitwise

A unary bitwise operator.

Fields of UnaryBitwise

op: UnaryBitwiseOparg: &'a Rvalue<'a>
BinaryBitwise

A binary bitwise operator.

Fields of BinaryBitwise

op: BinaryBitwiseOplhs: &'a Rvalue<'a>rhs: &'a Rvalue<'a>
IntUnaryArith

An integral unary arithmetic operator.

If any bit of the operand is x/z, the entire result is x.

Fields of IntUnaryArith

op: IntUnaryArithOpsign: Signdomain: Domainarg: &'a Rvalue<'a>
IntBinaryArith

An integral binary arithmetic operator.

If any bit of the operands are x/z, the entire result is x.

Fields of IntBinaryArith

op: IntBinaryArithOpsign: Signdomain: Domainlhs: &'a Rvalue<'a>rhs: &'a Rvalue<'a>
IntComp

An integral comparison operator.

If any bit of the operands are x/z, the entire result is x.

Fields of IntComp

op: IntCompOpsign: Signdomain: Domainlhs: &'a Rvalue<'a>rhs: &'a Rvalue<'a>
Concat(Vec<&'a Rvalue<'a>>)

Concatenate multiple values.

The values are cast to and treated as packed bit vectors, and the result is yet another packed bit vector.

Repeat(usize, &'a Rvalue<'a>)

Repeat a value multiple times.

The value is cast to and treated as a packed bit vector, and the result is yet another packed bit vector.

Var(NodeId)

A reference to a variable declaration.

Port(NodeId)

A reference to a port declaration.

Index

A bit- or part-select.

Fields of Index

value: &'a Rvalue<'a>base: &'a Rvalue<'a>length: usize

Length of the selection. Bit-select if zero.

Member

A struct field access.

Fields of Member

value: &'a Rvalue<'a>field: usize
Ternary

The ternary operator.

Fields of Ternary

cond: &'a Rvalue<'a>true_value: &'a Rvalue<'a>false_value: &'a Rvalue<'a>
Shift

A shift operation.

Fields of Shift

op: ShiftOparith: boolvalue: &'a Rvalue<'a>amount: &'a Rvalue<'a>
Reduction

A reduction operator.

Fields of Reduction

op: BinaryBitwiseOparg: &'a Rvalue<'a>
Assignment

An assignment operator.

Fields of Assignment

lvalue: &'a Lvalue<'a>rvalue: &'a Rvalue<'a>result: &'a Rvalue<'a>

What value is produced as the assignment's value. This is usually the rvalue, but may be different (e.g. for the i++ or i--).

Error

An error occurred during lowering.

Methods

impl<'a> RvalueKind<'a>[src]

pub fn is_error(&self) -> bool[src]

Check whether the rvalue represents a lowering error tombstone.

Trait Implementations

impl<'a> Clone for RvalueKind<'a>[src]

impl<'a> Debug for RvalueKind<'a>[src]

impl<'a> Eq for RvalueKind<'a>[src]

impl<'a> PartialEq<RvalueKind<'a>> for RvalueKind<'a>[src]

impl<'a> StructuralEq for RvalueKind<'a>[src]

impl<'a> StructuralPartialEq for RvalueKind<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for RvalueKind<'a>

impl<'a> Send for RvalueKind<'a>

impl<'a> Sync for RvalueKind<'a>

impl<'a> Unpin for RvalueKind<'a>

impl<'a> UnwindSafe for RvalueKind<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.