[−][src]Struct cranelift_codegen::isa::registers::RegClassData
Data about a register class.
A register class represents a subset of the registers in a bank. It describes the set of permitted registers for a register operand in a given encoding of an instruction.
A register class can be a subset of another register class. The top-level register classes are disjoint.
Fields
name: &'static str
The name of the register class.
index: u8
The index of this class in the ISA's RegInfo description.
width: u8
How many register units to allocate per register.
bank: u8
Index of the register bank this class belongs to.
toprc: u8
Index of the top-level register class contains this one.
first: RegUnit
The first register unit in this class.
subclasses: RegClassMask
Bit-mask of sub-classes of this register class, including itself.
Bits correspond to RC indexes.
mask: RegUnitMask
Mask of register units in the class. If width > 1
, the mask only has a bit set for the
first register unit in each allocatable register.
info: &'static RegInfo
The global RegInfo
instance containing this register class.
Methods
impl RegClassData
[src]
pub fn intersect_index(&self, other: RegClass) -> Option<RegClassIndex>
[src]
Get the register class index corresponding to the intersection of self
and other
.
This register class is guaranteed to exist if the register classes overlap. If the register
classes don't overlap, returns None
.
pub fn intersect(&self, other: RegClass) -> Option<RegClass>
[src]
Get the intersection of self
and other
.
pub fn has_subclass<RCI: Into<RegClassIndex>>(&self, other: RCI) -> bool
[src]
Returns true if other
is a subclass of this register class.
A register class is considered to be a subclass of itself.
pub fn toprc(&self) -> RegClass
[src]
Get the top-level register class containing this class.
pub fn unit(&self, offset: usize) -> RegUnit
[src]
Get a specific register unit in this class.
pub fn contains(&self, regunit: RegUnit) -> bool
[src]
Does this register class contain regunit
?
Trait Implementations
impl From<&'static RegClassData> for RegClassIndex
[src]
impl PartialEq<RegClassData> for RegClassData
[src]
Within an ISA, register classes are uniquely identified by their index.
impl Display for RegClassData
[src]
impl Debug for RegClassData
[src]
Auto Trait Implementations
impl Unpin for RegClassData
impl Send for RegClassData
impl Sync for RegClassData
impl UnwindSafe for RegClassData
impl RefUnwindSafe for RegClassData
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,