pub struct MoveCaps { /* private fields */ }Expand description
Implementations§
Source§impl MoveCaps
impl MoveCaps
Sourcepub const fn new(swap: bool, mem_to_mem: bool, store_imm: ImmRange) -> MoveCaps
pub const fn new(swap: bool, mem_to_mem: bool, store_imm: ImmRange) -> MoveCaps
Describes a target’s moves: whether it can exchange two registers in one instruction, move memory to memory directly, and which immediates it can store to memory directly.
§Examples
use backend_lang::target::{ImmRange, MoveCaps};
let caps = MoveCaps::new(false, false, ImmRange::None);
assert!(!caps.swap());Sourcepub const fn swap(self) -> bool
pub const fn swap(self) -> bool
Whether two registers of a class can be exchanged by one instruction
(x86-64 xchg).
§Examples
use backend_lang::x86_64;
assert!(x86_64::TARGET.move_caps().swap());Sourcepub const fn mem_to_mem(self) -> bool
pub const fn mem_to_mem(self) -> bool
Whether memory can be copied to memory without a register.
§Examples
use backend_lang::x86_64;
assert!(!x86_64::TARGET.move_caps().mem_to_mem());Trait Implementations§
impl Copy for MoveCaps
impl Eq for MoveCaps
impl StructuralPartialEq for MoveCaps
Auto Trait Implementations§
impl Freeze for MoveCaps
impl RefUnwindSafe for MoveCaps
impl Send for MoveCaps
impl Sync for MoveCaps
impl Unpin for MoveCaps
impl UnsafeUnpin for MoveCaps
impl UnwindSafe for MoveCaps
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