pub struct Inst {
pub mnemonic: String,
pub format: Format,
pub encoding: Encoding,
pub features: Features,
}
Expand description
An x64 instruction.
Use inst
to construct this within the
instructions
module. This structure is designed to
represent all of the information for one instruction (a table row) in the
x64 Instruction Set Reference or at least enough to generate code to emit
the instruction.
Fields§
§mnemonic: String
The instruction name as represented in the x64 reference manual. This is
the pretty-printed name used for disassembly. Multiple instructions may
have the same mnemonic, though; the combination of this field and the
format name must be unique (see Inst::name
).
format: Format
The instruction operands, typically represented in the “Instruction” column of the x64 reference manual.
encoding: Encoding
The instruction encoding, typically represented in the “Opcode” column of the x64 reference manual.
features: Features
The CPU features required to use this instruction; this combines the “64-bit/32-bit Mode Support” and “CPUID Feature Flag” columns of the x64 reference manual.
Implementations§
Source§impl Inst
impl Inst
Sourcepub fn name(&self) -> String
pub fn name(&self) -> String
The unique name for this instruction.
To avoid ambiguity, this name combines the instruction mnemonic and the
format name in snake case. This is used in generated code to name the
instruction struct
and builder functions.
In rare cases, this <mnemonic>_<format>
scheme does not uniquely
identify an instruction in x64 ISA (e.g., some extended versions,
VEX/EVEX). In these cases, we append a minimal identifier to
the format name (e.g., sx*
) to keep this unique.
Source§impl Inst
impl Inst
Sourcepub fn generate_struct(&self, f: &mut Formatter)
pub fn generate_struct(&self, f: &mut Formatter)
struct <inst> { <op>: Reg, <op>: Reg, ... }
Sourcepub fn generate_struct_impl(&self, f: &mut Formatter)
pub fn generate_struct_impl(&self, f: &mut Formatter)
impl <inst> { ... }
pub fn generate_new_function(&self, f: &mut Formatter)
Sourcepub fn generate_display_impl(&self, f: &mut Formatter)
pub fn generate_display_impl(&self, f: &mut Formatter)
impl Display for <inst> { ... }
Sourcepub fn generate_from_impl(&self, f: &mut Formatter)
pub fn generate_from_impl(&self, f: &mut Formatter)
impl From<struct> for Inst { ... }