[][src]Enum peepmatic_runtime::linear::MatchOp

pub enum MatchOp {
    Opcode {
        path: PathId,
    },
    IsConst {
        path: PathId,
    },
    IsPowerOfTwo {
        path: PathId,
    },
    BitWidth {
        path: PathId,
    },
    FitsInNativeWord {
        path: PathId,
    },
    Eq {
        path_a: PathId,
        path_b: PathId,
    },
    IntegerValue {
        path: PathId,
    },
    BooleanValue {
        path: PathId,
    },
    ConditionCode {
        path: PathId,
    },
    Nop,
}

A matching operation to be performed on some Cranelift instruction as part of determining whether an optimization is applicable.

Variants

Opcode

Switch on the opcode of an instruction.

Fields of Opcode

path: PathId

The path to the instruction whose opcode we're switching on.

IsConst

Does an instruction have a constant value?

Fields of IsConst

path: PathId

The path to the instruction (or immediate) that we're checking whether it is constant or not.

IsPowerOfTwo

Is the constant value a power of two?

Fields of IsPowerOfTwo

path: PathId

The path to the instruction (or immediate) that we are checking whether it is a constant power of two or not.

BitWidth

Switch on the bit width of a value.

Fields of BitWidth

path: PathId

The path to the instruction (or immediate) whose result's bit width we are checking.

FitsInNativeWord

Does the value fit in our target architecture's native word size?

Fields of FitsInNativeWord

path: PathId

The path to the instruction (or immediate) whose result we are checking whether it fits in a native word or not.

Eq

Are the instructions (or immediates) at the given paths the same?

Fields of Eq

path_a: PathId

The path to the first instruction (or immediate).

path_b: PathId

The path to the second instruction (or immediate).

IntegerValue

Switch on the constant integer value of an instruction.

Fields of IntegerValue

path: PathId

The path to the instruction.

BooleanValue

Switch on the constant boolean value of an instruction.

Fields of BooleanValue

path: PathId

The path to the instruction.

ConditionCode

Switch on a condition code.

Fields of ConditionCode

path: PathId

The path to the condition code.

Nop

No operation. Always evaluates to None.

Exceedingly rare in real optimizations; nonetheless required to support corner cases of the DSL, such as a LHS pattern that is nothing but a variable pattern.

Trait Implementations

impl Clone for MatchOp[src]

impl Copy for MatchOp[src]

impl Debug for MatchOp[src]

impl<'de> Deserialize<'de> for MatchOp[src]

impl Eq for MatchOp[src]

impl Hash for MatchOp[src]

impl PartialEq<MatchOp> for MatchOp[src]

impl Serialize for MatchOp[src]

impl StructuralEq for MatchOp[src]

impl StructuralPartialEq for MatchOp[src]

Auto Trait Implementations

impl RefUnwindSafe for MatchOp

impl Send for MatchOp

impl Sync for MatchOp

impl Unpin for MatchOp

impl UnwindSafe for MatchOp

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<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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.