Skip to main content

InstructionPattern

Enum InstructionPattern 

Source
pub enum InstructionPattern {
Show 67 variants Any, LoadImm { reg: Pat<u8>, value: Pat<i32>, }, LoadImm64 { reg: Pat<u8>, value: Pat<u64>, }, Add32 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, Sub32 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, Mul32 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, DivU32 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, DivS32 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, RemU32 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, RemS32 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, Add64 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, Sub64 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, Mul64 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, DivU64 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, DivS64 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, RemU64 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, RemS64 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, And { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, Or { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, Xor { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, ShloL32 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, ShloR32 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, SharR32 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, ShloL64 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, ShloR64 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, SharR64 { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, SetLtU { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, SetLtS { dst: Pat<u8>, src1: Pat<u8>, src2: Pat<u8>, }, SetLtUImm { dst: Pat<u8>, src: Pat<u8>, value: Pat<i32>, }, SetLtSImm { dst: Pat<u8>, src: Pat<u8>, value: Pat<i32>, }, Jump { offset: Pat<i32>, }, JumpInd { reg: Pat<u8>, offset: Pat<i32>, }, AddImm32 { dst: Pat<u8>, src: Pat<u8>, value: Pat<i32>, }, AddImm64 { dst: Pat<u8>, src: Pat<u8>, value: Pat<i32>, }, BranchLtU { reg1: Pat<u8>, reg2: Pat<u8>, offset: Pat<i32>, }, BranchGeU { reg1: Pat<u8>, reg2: Pat<u8>, offset: Pat<i32>, }, BranchEqImm { reg: Pat<u8>, value: Pat<i32>, offset: Pat<i32>, }, BranchNeImm { reg: Pat<u8>, value: Pat<i32>, offset: Pat<i32>, }, BranchGeSImm { reg: Pat<u8>, value: Pat<i32>, offset: Pat<i32>, }, LoadIndU8 { dst: Pat<u8>, base: Pat<u8>, offset: Pat<i32>, }, LoadIndI8 { dst: Pat<u8>, base: Pat<u8>, offset: Pat<i32>, }, LoadIndU16 { dst: Pat<u8>, base: Pat<u8>, offset: Pat<i32>, }, LoadIndI16 { dst: Pat<u8>, base: Pat<u8>, offset: Pat<i32>, }, LoadIndU32 { dst: Pat<u8>, base: Pat<u8>, offset: Pat<i32>, }, LoadIndU64 { dst: Pat<u8>, base: Pat<u8>, offset: Pat<i32>, }, StoreIndU8 { base: Pat<u8>, src: Pat<u8>, offset: Pat<i32>, }, StoreIndU16 { base: Pat<u8>, src: Pat<u8>, offset: Pat<i32>, }, StoreIndU32 { base: Pat<u8>, src: Pat<u8>, offset: Pat<i32>, }, StoreIndU64 { base: Pat<u8>, src: Pat<u8>, offset: Pat<i32>, }, CountSetBits32 { dst: Pat<u8>, src: Pat<u8>, }, CountSetBits64 { dst: Pat<u8>, src: Pat<u8>, }, LeadingZeroBits32 { dst: Pat<u8>, src: Pat<u8>, }, LeadingZeroBits64 { dst: Pat<u8>, src: Pat<u8>, }, TrailingZeroBits32 { dst: Pat<u8>, src: Pat<u8>, }, TrailingZeroBits64 { dst: Pat<u8>, src: Pat<u8>, }, SignExtend8 { dst: Pat<u8>, src: Pat<u8>, }, SignExtend16 { dst: Pat<u8>, src: Pat<u8>, }, ZeroExtend16 { dst: Pat<u8>, src: Pat<u8>, }, CmovIzImm { cond: Pat<u8>, dst: Pat<u8>, value: Pat<i32>, }, CmovNzImm { cond: Pat<u8>, dst: Pat<u8>, value: Pat<i32>, }, StoreImmU8 { address: Pat<i32>, value: Pat<i32>, }, StoreImmU16 { address: Pat<i32>, value: Pat<i32>, }, StoreImmU32 { address: Pat<i32>, value: Pat<i32>, }, StoreImmU64 { address: Pat<i32>, value: Pat<i32>, }, Trap, Fallthrough, Ecalli { index: Pat<u32>, },
}
Expand description

Pattern for matching instructions in tests

This allows flexible matching of instruction sequences where some fields can be wildcards or predicates.

Variants§

§

Any

Match any instruction

§

LoadImm

Match a specific instruction kind with pattern fields

Fields

§reg: Pat<u8>
§value: Pat<i32>
§

LoadImm64

Fields

§reg: Pat<u8>
§value: Pat<u64>
§

Add32

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

Sub32

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

Mul32

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

DivU32

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

DivS32

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

RemU32

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

RemS32

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

Add64

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

Sub64

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

Mul64

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

DivU64

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

DivS64

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

RemU64

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

RemS64

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

And

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

Or

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

Xor

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

ShloL32

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

ShloR32

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

SharR32

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

ShloL64

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

ShloR64

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

SharR64

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

SetLtU

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

SetLtS

Fields

§dst: Pat<u8>
§src1: Pat<u8>
§src2: Pat<u8>
§

SetLtUImm

Fields

§dst: Pat<u8>
§src: Pat<u8>
§value: Pat<i32>
§

SetLtSImm

Fields

§dst: Pat<u8>
§src: Pat<u8>
§value: Pat<i32>
§

Jump

Fields

§offset: Pat<i32>
§

JumpInd

Fields

§reg: Pat<u8>
§offset: Pat<i32>
§

AddImm32

Fields

§dst: Pat<u8>
§src: Pat<u8>
§value: Pat<i32>
§

AddImm64

Fields

§dst: Pat<u8>
§src: Pat<u8>
§value: Pat<i32>
§

BranchLtU

Fields

§reg1: Pat<u8>
§reg2: Pat<u8>
§offset: Pat<i32>
§

BranchGeU

Fields

§reg1: Pat<u8>
§reg2: Pat<u8>
§offset: Pat<i32>
§

BranchEqImm

Fields

§reg: Pat<u8>
§value: Pat<i32>
§offset: Pat<i32>
§

BranchNeImm

Fields

§reg: Pat<u8>
§value: Pat<i32>
§offset: Pat<i32>
§

BranchGeSImm

Fields

§reg: Pat<u8>
§value: Pat<i32>
§offset: Pat<i32>
§

LoadIndU8

Fields

§dst: Pat<u8>
§base: Pat<u8>
§offset: Pat<i32>
§

LoadIndI8

Fields

§dst: Pat<u8>
§base: Pat<u8>
§offset: Pat<i32>
§

LoadIndU16

Fields

§dst: Pat<u8>
§base: Pat<u8>
§offset: Pat<i32>
§

LoadIndI16

Fields

§dst: Pat<u8>
§base: Pat<u8>
§offset: Pat<i32>
§

LoadIndU32

Fields

§dst: Pat<u8>
§base: Pat<u8>
§offset: Pat<i32>
§

LoadIndU64

Fields

§dst: Pat<u8>
§base: Pat<u8>
§offset: Pat<i32>
§

StoreIndU8

Fields

§base: Pat<u8>
§src: Pat<u8>
§offset: Pat<i32>
§

StoreIndU16

Fields

§base: Pat<u8>
§src: Pat<u8>
§offset: Pat<i32>
§

StoreIndU32

Fields

§base: Pat<u8>
§src: Pat<u8>
§offset: Pat<i32>
§

StoreIndU64

Fields

§base: Pat<u8>
§src: Pat<u8>
§offset: Pat<i32>
§

CountSetBits32

Fields

§dst: Pat<u8>
§src: Pat<u8>
§

CountSetBits64

Fields

§dst: Pat<u8>
§src: Pat<u8>
§

LeadingZeroBits32

Fields

§dst: Pat<u8>
§src: Pat<u8>
§

LeadingZeroBits64

Fields

§dst: Pat<u8>
§src: Pat<u8>
§

TrailingZeroBits32

Fields

§dst: Pat<u8>
§src: Pat<u8>
§

TrailingZeroBits64

Fields

§dst: Pat<u8>
§src: Pat<u8>
§

SignExtend8

Fields

§dst: Pat<u8>
§src: Pat<u8>
§

SignExtend16

Fields

§dst: Pat<u8>
§src: Pat<u8>
§

ZeroExtend16

Fields

§dst: Pat<u8>
§src: Pat<u8>
§

CmovIzImm

Fields

§cond: Pat<u8>
§dst: Pat<u8>
§value: Pat<i32>
§

CmovNzImm

Fields

§cond: Pat<u8>
§dst: Pat<u8>
§value: Pat<i32>
§

StoreImmU8

Fields

§address: Pat<i32>
§value: Pat<i32>
§

StoreImmU16

Fields

§address: Pat<i32>
§value: Pat<i32>
§

StoreImmU32

Fields

§address: Pat<i32>
§value: Pat<i32>
§

StoreImmU64

Fields

§address: Pat<i32>
§value: Pat<i32>
§

Trap

§

Fallthrough

§

Ecalli

Fields

§index: Pat<u32>

Implementations§

Source§

impl InstructionPattern

Source

pub fn matches(&self, instr: &Instruction) -> bool

Check if an instruction matches this pattern

Trait Implementations§

Source§

impl Clone for InstructionPattern

Source§

fn clone(&self) -> InstructionPattern

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InstructionPattern

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more