pub(crate) struct InstructionFormat {
    pub name: &'static str,
    pub num_value_operands: usize,
    pub has_value_list: bool,
    pub imm_fields: Vec<FormatField>,
    pub num_block_operands: usize,
    pub typevar_operand: Option<usize>,
}
Expand description

Every instruction opcode has a corresponding instruction format which determines the number of operands and their kinds. Instruction formats are identified structurally, i.e., the format of an instruction is derived from the kinds of operands used in its declaration.

The instruction format stores two separate lists of operands: Immediates and values. Immediate operands (including entity references) are represented as explicit members in the InstructionData variants. The value operands are stored differently, depending on how many there are. Beyond a certain point, instruction formats switch to an external value list for storing value arguments. Value lists can hold an arbitrary number of values.

All instruction formats must be predefined in the meta shared/formats.rs module.

Fields§

§name: &'static str

Instruction format name in CamelCase. This is used as a Rust variant name in both the InstructionData and InstructionFormat enums.

§num_value_operands: usize§has_value_list: bool§imm_fields: Vec<FormatField>§num_block_operands: usize§typevar_operand: Option<usize>

Index of the value input operand that is used to infer the controlling type variable. By default, this is 0, the first value operand. The index is relative to the values only, ignoring immediate operands.

Implementations§

Returns a tuple that uniquely identifies the structure.

Trait Implementations§

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.