pub struct Format {
pub name: String,
pub operands: Vec<Operand>,
}
Expand description
A format describes the operands for an instruction.
Fields§
§name: String
This name, when combined with the instruction mnemonic, uniquely identifies an instruction. The reference manual uses this name in the “Instruction Operand Encoding” table.
operands: Vec<Operand>
These operands should match the “Instruction” column ing the reference manual.
Implementations§
Source§impl Format
impl Format
Sourcepub fn locations(&self) -> impl Iterator<Item = &Location> + '_
pub fn locations(&self) -> impl Iterator<Item = &Location> + '_
Iterate over the operand locations.
Sourcepub fn uses_memory(&self) -> Option<Location>
pub fn uses_memory(&self) -> Option<Location>
Return the location of the operand that uses memory, if any; return
None
otherwise.
Sourcepub fn uses_variable_register(&self) -> bool
pub fn uses_variable_register(&self) -> bool
Return true
if any of the operands accepts a variable register (i.e.,
not a fixed register, immediate); return false
otherwise.
Sourcepub fn operands_by_kind(&self) -> Vec<OperandKind>
pub fn operands_by_kind(&self) -> Vec<OperandKind>
Collect into operand kinds.
Source§impl Format
impl Format
Sourcepub fn generate_att_style_operands(&self) -> String
pub fn generate_att_style_operands(&self) -> String
Re-order the Intel-style operand order to accommodate ATT-style printing.
This is an unfortunate necessity to match Cranelift’s current disassembly, which uses AT&T-style printing. The plan is to eventually transition to Intel-style printing (and avoid this awkward reordering) once Cranelift has switched to using this assembler predominantly (TODO).