pub struct Reg(/* private fields */);
Expand description
A register named in an instruction. This register can be a virtual
register, a fixed physical register, or a named spillslot (after
regalloc). 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 const fn from_virtual_reg(vreg: VReg) -> Reg
pub const fn from_virtual_reg(vreg: VReg) -> Reg
Const constructor: create a new Reg from a regalloc2 VReg.
Sourcepub const fn from_real_reg(preg: PReg) -> Reg
pub const fn from_real_reg(preg: PReg) -> Reg
Const constructor: create a new Reg from a regalloc2 PReg.
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 to_spillslot(self) -> Option<SpillSlot>
pub fn to_spillslot(self) -> Option<SpillSlot>
Get the spillslot, if this register is one.
Sourcepub fn is_virtual(self) -> bool
pub fn is_virtual(self) -> bool
Is this a virtual reg?
Sourcepub fn is_spillslot(self) -> bool
pub fn is_spillslot(self) -> bool
Is this a spillslot?
Trait Implementations§
Source§impl AsMut<Reg> for Gpr
Available on crate feature x86
only.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.
impl AsMut<Reg> for Gpr
x86
only.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
Available on crate feature x86
only.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.
impl AsMut<Reg> for Xmm
x86
only.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<'de> Deserialize<'de> for Reg
impl<'de> Deserialize<'de> for Reg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.