pub struct Opcode(/* private fields */);Expand description
A machine opcode: an index into the target’s instruction table.
Every target’s table begins with the two generic pseudo-instructions
Opcode::COPY and Opcode::PCOPY; the rest are the target’s own
(for x86-64, the constants in x86_64::op).
§Examples
use backend_lang::target::Opcode;
use backend_lang::x86_64::{self, op};
assert_eq!(x86_64::TARGET.inst(Opcode::COPY).unwrap().name(), "copy");
assert_eq!(x86_64::TARGET.inst(op::ADD64).unwrap().name(), "add64");Implementations§
Source§impl Opcode
impl Opcode
Sourcepub const COPY: Opcode
pub const COPY: Opcode
dst = copy src: one move between registers, stack slots, or from an
immediate. Lowered through the parallel-move resolver, so a
slot-to-slot copy gets a temporary register as the target requires.
A copy’s width is its register’s class; a copy with no register
(slot to slot, or an immediate to a slot) moves a value of the
target’s address class (8 bytes on x86-64).
Sourcepub const PCOPY: Opcode
pub const PCOPY: Opcode
d0, d1, ... = pcopy s0, s1, ...: a parallel copy. Every source is
read before any destination is written, as on a control-flow edge.
Lowered through the parallel-move resolver.