[][src]Struct cranelift_codegen_meta::isa::x86::encodings::PerCpuModeEncodings

pub(crate) struct PerCpuModeEncodings {
    pub enc32: Vec<Rc<EncodingContent>>,
    pub enc64: Vec<Rc<EncodingContent>>,
    pub recipes: PrimaryMap<EncodingRecipeNumber, EncodingRecipe>,
    recipes_by_name: HashMap<String, EncodingRecipeNumber>,
    pub inst_pred_reg: InstructionPredicateRegistry,
}

Fields

enc32: Vec<Rc<EncodingContent>>enc64: Vec<Rc<EncodingContent>>recipes: PrimaryMap<EncodingRecipeNumber, EncodingRecipe>recipes_by_name: HashMap<String, EncodingRecipeNumber>inst_pred_reg: InstructionPredicateRegistry

Methods

impl PerCpuModeEncodings[src]

fn new() -> Self[src]

fn add_recipe(&mut self, recipe: EncodingRecipe) -> EncodingRecipeNumber[src]

fn make_encoding<T>(
    &mut self,
    inst: InstSpec,
    template: Template,
    builder_closure: T
) -> Rc<EncodingContent> where
    T: FnOnce(EncodingBuilder) -> EncodingBuilder
[src]

fn enc32_func<T>(
    &mut self,
    inst: impl Into<InstSpec>,
    template: Template,
    builder_closure: T
) where
    T: FnOnce(EncodingBuilder) -> EncodingBuilder
[src]

fn enc32(&mut self, inst: impl Into<InstSpec>, template: Template)[src]

fn enc32_isap(
    &mut self,
    inst: impl Into<InstSpec>,
    template: Template,
    isap: u8
)
[src]

fn enc32_instp(
    &mut self,
    inst: impl Into<InstSpec>,
    template: Template,
    instp: InstructionPredicateNode
)
[src]

fn enc32_rec(
    &mut self,
    inst: impl Into<InstSpec>,
    recipe: &EncodingRecipe,
    bits: u16
)
[src]

fn enc64_func<T>(
    &mut self,
    inst: impl Into<InstSpec>,
    template: Template,
    builder_closure: T
) where
    T: FnOnce(EncodingBuilder) -> EncodingBuilder
[src]

fn enc64(&mut self, inst: impl Into<InstSpec>, template: Template)[src]

fn enc64_isap(
    &mut self,
    inst: impl Into<InstSpec>,
    template: Template,
    isap: u8
)
[src]

fn enc64_instp(
    &mut self,
    inst: impl Into<InstSpec>,
    template: Template,
    instp: InstructionPredicateNode
)
[src]

fn enc64_rec(
    &mut self,
    inst: impl Into<InstSpec>,
    recipe: &EncodingRecipe,
    bits: u16
)
[src]

fn enc_i32_i64(&mut self, inst: impl Into<InstSpec>, template: Template)[src]

Adds I32/I64 encodings as appropriate for a typed instruction. The REX prefix is always inferred at runtime.

Add encodings for inst.i32 to X86_32. Add encodings for inst.i32 to X86_64 with optional, inferred REX. Add encodings for inst.i64 to X86_64 with a REX.W prefix.

fn enc_i32_i64_explicit_rex(
    &mut self,
    inst: impl Into<InstSpec>,
    template: Template
)
[src]

Adds I32/I64 encodings as appropriate for a typed instruction. All variants of REX prefix are explicitly emitted, not inferred.

Add encodings for inst.i32 to X86_32. Add encodings for inst.i32 to X86_64 with and without REX. Add encodings for inst.i64 to X86_64 with and without REX.

fn enc_b32_b64(&mut self, inst: impl Into<InstSpec>, template: Template)[src]

Adds B32/B64 encodings as appropriate for a typed instruction. The REX prefix is always inferred at runtime.

Adds encoding for inst.b32 to X86_32. Adds encoding for inst.b32 to X86_64 with optional, inferred REX. Adds encoding for inst.b64 to X86_64 with a REX.W prefix.

fn enc_i32_i64_rex_only(
    &mut self,
    inst: impl Into<InstSpec>,
    template: Template
)
[src]

Add encodings for inst.i32 to X86_32. Add encodings for inst.i32 to X86_64 with a REX prefix. Add encodings for inst.i64 to X86_64 with a REX.W prefix.

fn enc_i32_i64_instp(
    &mut self,
    inst: &Rc<InstructionContent>,
    template: Template,
    instp: InstructionPredicateNode
)
[src]

Add encodings for inst.i32 to X86_32. Add encodings for inst.i32 to X86_64 with and without REX. Add encodings for inst.i64 to X86_64 with a REX.W prefix.

fn enc_r32_r64_rex_only(
    &mut self,
    inst: impl Into<InstSpec>,
    template: Template
)
[src]

Add encodings for inst.r32 to X86_32. Add encodings for inst.r64 to X86_64 with a REX.W prefix.

fn enc_r32_r64_ld_st(
    &mut self,
    inst: &Rc<InstructionContent>,
    w_bit: bool,
    template: Template
)
[src]

fn enc_x86_64(&mut self, inst: impl Into<InstSpec> + Clone, template: Template)[src]

Add encodings for inst to X86_64 with and without a REX prefix.

fn enc_x86_64_instp(
    &mut self,
    inst: impl Clone + Into<InstSpec>,
    template: Template,
    instp: InstructionPredicateNode
)
[src]

Add encodings for inst to X86_64 with and without a REX prefix.

fn enc_x86_64_isap(
    &mut self,
    inst: impl Clone + Into<InstSpec>,
    template: Template,
    isap: u8
)
[src]

fn enc_both(&mut self, inst: impl Clone + Into<InstSpec>, template: Template)[src]

Add all three encodings for inst:

  • X86_32
  • X86_64 with and without the REX prefix.

fn enc_both_isap(
    &mut self,
    inst: impl Clone + Into<InstSpec>,
    template: Template,
    isap: u8
)
[src]

fn enc_both_instp(
    &mut self,
    inst: impl Clone + Into<InstSpec>,
    template: Template,
    instp: InstructionPredicateNode
)
[src]

fn enc_both_rex_only(
    &mut self,
    inst: impl Clone + Into<InstSpec>,
    template: Template
)
[src]

Add two encodings for inst:

  • X86_32
  • X86_64 with the REX prefix.

fn enc_i32_i64_ld_st(
    &mut self,
    inst: &Rc<InstructionContent>,
    w_bit: bool,
    template: Template
)
[src]

Add encodings for inst.i32 to X86_32. Add encodings for inst.i32 to X86_64 with and without REX. Add encodings for inst.i64 to X86_64 with a REX prefix, using the w_bit argument to determine whether or not to set the REX.W bit.

fn enc_32_64(&mut self, inst: impl Clone + Into<InstSpec>, template: Template)[src]

Add the same encoding/template pairing to both X86_32 and X86_64

fn enc_32_64_rec(
    &mut self,
    inst: impl Clone + Into<InstSpec>,
    recipe: &EncodingRecipe,
    bits: u16
)
[src]

Add the same encoding/recipe pairing to both X86_32 and X86_64

fn enc_32_64_func<T>(
    &mut self,
    inst: impl Clone + Into<InstSpec>,
    template: Template,
    builder_closure: T
) where
    T: FnOnce(EncodingBuilder) -> EncodingBuilder
[src]

Add the same encoding to both X86_32 and X86_64; assumes configuration (e.g. REX, operand binding) has already happened

fn enc_32_64_maybe_isap(
    &mut self,
    inst: impl Clone + Into<InstSpec>,
    template: Template,
    isap: Option<u8>
)
[src]

Add the same encoding to both X86_32 and X86_64; assumes configuration (e.g. REX, operand binding) has already happened.

fn enc32_maybe_isap(
    &mut self,
    inst: impl Into<InstSpec>,
    template: Template,
    isap: Option<u8>
)
[src]

fn enc64_maybe_isap(
    &mut self,
    inst: impl Into<InstSpec>,
    template: Template,
    isap: Option<u8>
)
[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, 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.