[][src]Struct cranelift_codegen_meta::isa::x86::recipes::Template

pub(crate) struct Template<'builder> {
    regs: &'builder IsaRegs,
    recipe: EncodingRecipeBuilder,
    rex_kind: RexRecipeKind,
    inferred_rex_compute_size: Option<&'static str>,
    when_prefixed: Option<Rc<Template<'builder>>>,
    w_bit: u16,
    rrr_bits: u16,
    op_bytes: &'static [u8],
}

Previously called a TailRecipe in the Python meta language, this allows to create multiple variants of a single base EncodingRecipe (rex prefix, specialized w/rrr bits, different opcodes). It serves as a prototype of an EncodingRecipe, which is then used when actually creating Encodings, in encodings.rs. This is an idiosyncrasy of the x86 meta-language, and could be reconsidered later.

Fields

regs: &'builder IsaRegs

Description of registers, used in the build() method.

recipe: EncodingRecipeBuilder

The recipe template, which is to be specialized (by copy).

rex_kind: RexRecipeKind

How is the REX prefix emitted?

inferred_rex_compute_size: Option<&'static str>

Function for compute_size() when REX is inferrable.

when_prefixed: Option<Rc<Template<'builder>>>

Other recipe to use when REX-prefixed.

w_bit: u16

Value of the W bit (0 or 1), stored in the EncodingBits.

rrr_bits: u16

Value of the RRR bits (between 0 and 0b111).

op_bytes: &'static [u8]

Opcode bytes.

Methods

impl<'builder> Template<'builder>[src]

fn new(recipe: EncodingRecipeBuilder, regs: &'builder IsaRegs) -> Self[src]

fn name(&self) -> &str[src]

fn rex_kind(self, kind: RexRecipeKind) -> Self[src]

fn inferred_rex_compute_size(self, function: &'static str) -> Self[src]

fn when_prefixed(self, template: Rc<Template<'builder>>) -> Self[src]

pub fn opcodes(&self, op_bytes: &'static [u8]) -> Self[src]

pub fn w(&self) -> Self[src]

pub fn rrr(&self, value: u16) -> Self[src]

pub fn nonrex(&self) -> Self[src]

pub fn rex(&self) -> Self[src]

pub fn infer_rex(&self) -> Self[src]

pub fn build(self) -> (EncodingRecipe, u16)[src]

Trait Implementations

impl<'builder> Clone for Template<'builder>[src]

Auto Trait Implementations

impl<'builder> !RefUnwindSafe for Template<'builder>

impl<'builder> !Send for Template<'builder>

impl<'builder> !Sync for Template<'builder>

impl<'builder> Unpin for Template<'builder>

impl<'builder> !UnwindSafe for Template<'builder>

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.