Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl PRegSet {
}

/// Add a physical register (PReg) to the set.
pub fn add(&mut self, reg: PReg) {
pub const fn add(&mut self, reg: PReg) {
let (index, bit) = Self::split_index(reg);
self.bits[index] |= 1 << bit;
}
Expand Down Expand Up @@ -462,6 +462,11 @@ impl VReg {
pub const fn bits(self) -> usize {
self.bits as usize
}

#[inline(always)]
pub const fn from_bits(bits: u32) -> VReg {
Self { bits }
}
}

impl From<u32> for VReg {
Expand Down