pub struct Move {
pub dst: Loc,
pub src: Source,
pub class: RegClass,
}Expand description
One copy of a parallel copy: dst := src, of register class class.
§Examples
use backend_lang::moves::Move;
use backend_lang::x86_64::{GPR, RAX, RBX};
let m = Move::new(RAX, RBX, GPR);
assert_eq!(m.class, GPR);Fields§
§dst: LocThe destination.
src: SourceThe source.
class: RegClassThe class of the value moved, which picks scratch and temporary registers and the width of the move.
Implementations§
Source§impl Move
impl Move
Sourcepub fn new(dst: impl Into<Loc>, src: impl Into<Source>, class: RegClass) -> Move
pub fn new(dst: impl Into<Loc>, src: impl Into<Source>, class: RegClass) -> Move
dst := src of class.
§Examples
use backend_lang::mir::StackSlot;
use backend_lang::moves::{Loc, Move, Source};
use backend_lang::x86_64::{GPR, RSI};
let spill = Move::new(StackSlot::new(0), RSI, GPR);
assert_eq!(spill.dst, Loc::Slot(StackSlot::new(0)));
assert_eq!(spill.src, Source::from(RSI));Trait Implementations§
impl Copy for Move
impl Eq for Move
impl StructuralPartialEq for Move
Auto Trait Implementations§
impl Freeze for Move
impl RefUnwindSafe for Move
impl Send for Move
impl Sync for Move
impl Unpin for Move
impl UnsafeUnpin for Move
impl UnwindSafe for Move
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