Struct cranelift_codegen::Reg
source · pub struct Reg(/* private fields */);
Expand description
A register named in an instruction. This register can be either a
virtual register or a fixed physical register. It does not have
any constraints applied to it: those can be added later in
MachInst::get_operands()
when the Reg
s are converted to
Operand
s.
Implementations§
source§impl Reg
impl Reg
sourcepub fn to_real_reg(self) -> Option<RealReg>
pub fn to_real_reg(self) -> Option<RealReg>
Get the physical register (RealReg
), if this register is
one.
sourcepub fn to_virtual_reg(self) -> Option<VirtualReg>
pub fn to_virtual_reg(self) -> Option<VirtualReg>
Get the virtual (non-physical) register, if this register is one.
sourcepub fn is_virtual(self) -> bool
pub fn is_virtual(self) -> bool
Is this a virtual reg?
Trait Implementations§
source§impl AsMut<Reg> for Gpr
impl AsMut<Reg> for Gpr
If you know what you’re doing, you can explicitly mutably borrow the
underlying Reg
. Don’t make it point to the wrong type of register
please.
source§impl AsMut<Reg> for Xmm
impl AsMut<Reg> for Xmm
If you know what you’re doing, you can explicitly mutably borrow the
underlying Reg
. Don’t make it point to the wrong type of register
please.
source§impl Ord for Reg
impl Ord for Reg
source§impl PartialOrd for Reg
impl PartialOrd for Reg
impl Copy for Reg
impl Eq for Reg
impl StructuralPartialEq for Reg
Auto Trait Implementations§
impl Freeze for Reg
impl RefUnwindSafe for Reg
impl Send for Reg
impl Sync for Reg
impl Unpin for Reg
impl UnwindSafe for Reg
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.