pub enum Step {
Move {
dst: Loc,
src: Source,
class: RegClass,
},
Swap {
a: PReg,
b: PReg,
class: RegClass,
},
}Expand description
One step of the resolved sequence, each executable by one target instruction.
§Examples
use backend_lang::moves::{Move, MoveEnv, MoveResolver, Step};
use backend_lang::x86_64::{self, GPR, RAX, RBX};
// Swap two registers: one xchg on x86-64.
let swap = [Move::new(RAX, RBX, GPR), Move::new(RBX, RAX, GPR)];
let mut out = Vec::new();
MoveResolver::new().resolve(&x86_64::TARGET, &swap, &MoveEnv::new(), &mut out)?;
assert_eq!(out, [Step::Swap { a: RAX, b: RBX, class: GPR }]);Variants§
Move
dst := src. Never memory to memory on a target that cannot, and
never a store of an immediate the target cannot store.
Swap
Exchange two registers of class.
Trait Implementations§
impl Copy for Step
impl Eq for Step
impl StructuralPartialEq for Step
Auto Trait Implementations§
impl Freeze for Step
impl RefUnwindSafe for Step
impl Send for Step
impl Sync for Step
impl Unpin for Step
impl UnsafeUnpin for Step
impl UnwindSafe for Step
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more