Struct cranelift_codegen::isa::registers::RegClassData[][src]

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,
    pub pinned_reg: Option<RegUnit>,
}
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 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.

pinned_reg: Option<RegUnit>

The “pinned” register of the associated register bank.

This register must be non-volatile (callee-preserved) and must not be the fixed output register of any instruction.

Implementations

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.

Get the intersection of self and other.

Returns true if other is a subclass of this register class. A register class is considered to be a subclass of itself.

Get the top-level register class containing this class.

Get a specific register unit in this class.

Does this register class contain regunit?

If the pinned register is used, is the given regunit the pinned register of this class?

Calculate the index of the register inside the class.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Within an ISA, register classes are uniquely identified by their index.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.