Struct cranelift_codegen::isa::registers::RegClassData
source · pub struct RegClassData {
pub name: &'static str,
pub index: u8,
pub width: u8,
pub bank: u8,
pub toprc: u8,
pub first: RegUnit,
pub subclasses: RegClassMask,
pub mask: RegUnitMask,
pub info: &'static RegInfo,
}Expand description
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 strThe name of the register class.
index: u8The index of this class in the ISA’s RegInfo description.
width: u8How many register units to allocate per register.
bank: u8Index of the register bank this class belongs to.
toprc: u8Index of the top-level register class contains this one.
first: RegUnitThe first register unit in this class.
subclasses: RegClassMaskBit-mask of sub-classes of this register class, including itself.
Bits correspond to RC indexes.
mask: RegUnitMaskMask 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 RegInfoThe global RegInfo instance containing this register class.
Implementations§
source§impl RegClassData
impl RegClassData
sourcepub fn intersect_index(&self, other: RegClass) -> Option<RegClassIndex>
pub fn intersect_index(&self, other: RegClass) -> Option<RegClassIndex>
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.
sourcepub fn intersect(&self, other: RegClass) -> Option<RegClass>
pub fn intersect(&self, other: RegClass) -> Option<RegClass>
Get the intersection of self and other.
sourcepub fn has_subclass<RCI: Into<RegClassIndex>>(&self, other: RCI) -> bool
pub fn has_subclass<RCI: Into<RegClassIndex>>(&self, other: RCI) -> bool
Returns true if other is a subclass of this register class.
A register class is considered to be a subclass of itself.
Trait Implementations§
source§impl Debug for RegClassData
impl Debug for RegClassData
source§impl Display for RegClassData
impl Display for RegClassData
source§impl From<&'static RegClassData> for RegClassIndex
impl From<&'static RegClassData> for RegClassIndex
source§impl PartialEq<RegClassData> for RegClassData
impl PartialEq<RegClassData> for RegClassData
Within an ISA, register classes are uniquely identified by their index.