[][src]Struct cranelift_codegen_meta::cdsl::recipes::EncodingRecipe

pub(crate) struct EncodingRecipe {
    pub name: String,
    pub format: Rc<InstructionFormat>,
    pub base_size: u64,
    pub operands_in: Vec<OperandConstraint>,
    pub operands_out: Vec<OperandConstraint>,
    pub compute_size: &'static str,
    pub branch_range: Option<BranchRange>,
    pub clobbers_flags: bool,
    pub inst_predicate: Option<InstructionPredicate>,
    pub isa_predicate: Option<u8>,
    pub emit: Option<String>,
}

A recipe for encoding instructions with a given format.

Many different instructions can be encoded by the same recipe, but they must all have the same instruction format.

The operands_in and operands_out arguments are tuples specifying the register allocation constraints for the value operands and results respectively. The possible constraints for an operand are:

  • A RegClass specifying the set of allowed registers.
  • A Register specifying a fixed-register operand.
  • An integer indicating that this result is tied to a value operand, so they must use the same register.
  • A Stack specifying a value in a stack slot.

The branch_range argument must be provided for recipes that can encode branch instructions. It is an (origin, bits) tuple describing the exact range that can be encoded in a branch instruction.

Fields

name: String

Short mnemonic name for this recipe.

format: Rc<InstructionFormat>

Associated instruction format.

base_size: u64

Base number of bytes in the binary encoded instruction.

operands_in: Vec<OperandConstraint>

Tuple of register constraints for value operands.

operands_out: Vec<OperandConstraint>

Tuple of register constraints for results.

compute_size: &'static str

Function name to use when computing actual size.

branch_range: Option<BranchRange>

(origin, bits) range for branches.

clobbers_flags: bool

This instruction clobbers iflags and fflags; true by default.

inst_predicate: Option<InstructionPredicate>

Instruction predicate.

isa_predicate: Option<u8>

ISA predicate.

emit: Option<String>

Rust code for binary emission.

Trait Implementations

impl Clone for EncodingRecipe[src]

impl Eq for EncodingRecipe[src]

impl PartialEq<EncodingRecipe> for EncodingRecipe[src]

Auto Trait Implementations

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> 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.