pub struct Reg(/* private fields */);Expand description
A register, either one the allocator has still to place or one it has placed.
The two are one type and four bytes because every operand holds one and because a pass that runs both before and after allocation should not be two passes. Which of the two it is, is the top bit, so a virtual register is its own number and nothing has to be masked to compare two of them.
Implementations§
Source§impl Reg
impl Reg
Sourcepub const fn virtual_reg(number: u32) -> Self
pub const fn virtual_reg(number: u32) -> Self
The virtual register with that number.
§Panics
Panics if the number is two billion or more, which no function reaches.
Sourcepub const fn is_virtual(self) -> bool
pub const fn is_virtual(self) -> bool
Whether the allocator has still to place it.
Trait Implementations§
impl Copy for Reg
impl Eq for Reg
Source§impl Ord for Reg
impl Ord for Reg
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Reg
impl PartialOrd 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 UnsafeUnpin 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