Enum peepmatic_runtime::linear::MatchOp [−][src]
pub enum MatchOp {
Opcode(LhsId),
IsConst(LhsId),
IsPowerOfTwo(LhsId),
BitWidth(LhsId),
FitsInNativeWord(LhsId),
Eq(LhsId, LhsId),
IntegerValue(LhsId),
BooleanValue(LhsId),
ConditionCode(LhsId),
Nop,
}
Expand description
A matching operation to be performed on some Cranelift instruction as part of determining whether an optimization is applicable.
Variants
Opcode(LhsId)
Switch on the opcode of an instruction.
Upon successfully matching an instruction’s opcode, bind each of its operands to a LHS temporary.
Tuple Fields of Opcode
0: LhsId
IsConst(LhsId)
Does an instruction have a constant value?
Tuple Fields of IsConst
0: LhsId
IsPowerOfTwo(LhsId)
Is the constant value a power of two?
Tuple Fields of IsPowerOfTwo
0: LhsId
BitWidth(LhsId)
Switch on the bit width of a value.
Tuple Fields of BitWidth
0: LhsId
FitsInNativeWord(LhsId)
Does the value fit in our target architecture’s native word size?
Tuple Fields of FitsInNativeWord
0: LhsId
Are the instructions (or immediates) the same?
IntegerValue(LhsId)
Switch on the constant integer value of an instruction.
Tuple Fields of IntegerValue
0: LhsId
BooleanValue(LhsId)
Switch on the constant boolean value of an instruction.
Tuple Fields of BooleanValue
0: LhsId
ConditionCode(LhsId)
Switch on a condition code.
Tuple Fields of ConditionCode
0: LhsId
No operation. Always evaluates to Else
.
Never appears in real optimizations; nonetheless required to support corner cases of the DSL, such as a LHS pattern that is nothing but a variable.
Trait Implementations
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
Auto Trait Implementations
impl RefUnwindSafe for MatchOp
impl UnwindSafe for MatchOp
Blanket Implementations
Mutably borrows from an owned value. Read more