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

pub enum RvalueKind<'a> {
Show 31 variants CastValueDomain { from: Domain, to: Domain, value: &'a Rvalue<'a>, }, Transmute(&'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), Intf(NodeId), IntfSignal(&'a Rvalue<'a>, 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>, }, PackString(&'a Rvalue<'a>), UnpackString(&'a Rvalue<'a>), StringComp { op: StringCompOp, lhs: &'a Rvalue<'a>, rhs: &'a Rvalue<'a>, }, Error,
}
Expand description

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>
Transmute(&'a Rvalue<'a>)

A type cast which does not incur any operation. For example, going from bit [31:0] to int, or vice versa.

Tuple Fields of Transmute

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

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

Tuple Fields of CastSign

0: Sign1: &'a Rvalue<'a>
CastToBool(&'a Rvalue<'a>)

A cast from a simple bit type to a boolean.

Tuple Fields of CastToBool

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

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

Tuple Fields of Truncate

0: usize1: &'a Rvalue<'a>
ZeroExtend(usize, &'a Rvalue<'a>)

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

Tuple Fields of ZeroExtend

0: usize1: &'a Rvalue<'a>
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].

Tuple Fields of SignExtend

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

Constructor for an array.

Tuple Fields of ConstructArray

0: HashMap<usize, &'a Rvalue<'a>>
ConstructStruct(Vec<&'a Rvalue<'a>>)

Constructor for a struct.

Tuple Fields of ConstructStruct

0: Vec<&'a Rvalue<'a>>
Const(Value<'a>)

A constant value.

Tuple Fields of Const

0: Value<'a>
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. The lowest index corresponds to the left-most item in the concatenation, which is at the MSB end of the final packed bit vector.

Tuple Fields of Concat

0: Vec<&'a Rvalue<'a>>
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.

Tuple Fields of Repeat

0: usize1: &'a Rvalue<'a>
Var(NodeId)

A reference to a variable declaration.

Tuple Fields of Var

0: NodeId
Port(NodeId)

A reference to a port declaration.

Tuple Fields of Port

0: NodeId
Intf(NodeId)

A reference to an interface.

Tuple Fields of Intf

0: NodeId
IntfSignal(&'a Rvalue<'a>, NodeId)

A reference to a locally instantiated interface signal.

Tuple Fields of IntfSignal

0: &'a Rvalue<'a>1: NodeId
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--).

PackString(&'a Rvalue<'a>)

Pack a string value into a fixed-size packed bit vector.

Tuple Fields of PackString

0: &'a Rvalue<'a>
UnpackString(&'a Rvalue<'a>)

Unpack a string value from a fixed-size packed bit vector.

Tuple Fields of UnpackString

0: &'a Rvalue<'a>
StringComp

A string comparison operator.

Fields of StringComp

op: StringCompOplhs: &'a Rvalue<'a>rhs: &'a Rvalue<'a>
Error

An error occurred during lowering.

Implementations

Check whether the rvalue represents a lowering error tombstone.

Check whether this rvalue is a constant.

Trait Implementations

Walk a visitor over the contents of self.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Walk a visitor over self.

Calling this function is equivalent to calling:

  • visitor.pre_visit_rvalue_kind(self)
  • self.accept(visitor)
  • visitor.post_visit_rvalue_kind(self);

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.