Address review feedback
This commit is contained in:
13
src/lib.rs
13
src/lib.rs
@@ -60,8 +60,8 @@ pub enum RegClass {
|
|||||||
/// The value returned by `index()`, in contrast, is in a single index
|
/// The value returned by `index()`, in contrast, is in a single index
|
||||||
/// space shared by all classes, in order to enable uniform reasoning
|
/// space shared by all classes, in order to enable uniform reasoning
|
||||||
/// about physical registers. This is done by putting the class bit at
|
/// about physical registers. This is done by putting the class bit at
|
||||||
/// the MSB, or equivalently, declaring that indices 0..63 are the 64
|
/// the MSB, or equivalently, declaring that indices 0..=63 are the 64
|
||||||
/// integer registers and indices 64..127 are the 64 float registers.
|
/// integer registers and indices 64..=127 are the 64 float registers.
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub struct PReg {
|
pub struct PReg {
|
||||||
hw_enc: u8,
|
hw_enc: u8,
|
||||||
@@ -383,7 +383,6 @@ pub enum OperandPos {
|
|||||||
/// that the conflict (overlap) is properly accounted for. See
|
/// that the conflict (overlap) is properly accounted for. See
|
||||||
/// comments on the constructors below for more.
|
/// comments on the constructors below for more.
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
//#[repr(packed)]
|
|
||||||
pub struct Operand {
|
pub struct Operand {
|
||||||
/// Bit-pack into 32 bits.
|
/// Bit-pack into 32 bits.
|
||||||
///
|
///
|
||||||
@@ -392,6 +391,14 @@ pub struct Operand {
|
|||||||
/// where `constraint` is an `OperandConstraint`, `kind` is an
|
/// where `constraint` is an `OperandConstraint`, `kind` is an
|
||||||
/// `OperandKind`, `pos` is an `OperandPos`, `class` is a
|
/// `OperandKind`, `pos` is an `OperandPos`, `class` is a
|
||||||
/// `RegClass`, and `vreg` is a vreg index.
|
/// `RegClass`, and `vreg` is a vreg index.
|
||||||
|
///
|
||||||
|
/// The constraints are encoded as follows:
|
||||||
|
/// - 1xxxxxx => FixedReg(preg)
|
||||||
|
/// - 01xxxxx => Reuse(index)
|
||||||
|
/// - 0000000 => Any
|
||||||
|
/// - 0000001 => Reg
|
||||||
|
/// - 0000010 => Stack
|
||||||
|
/// - _ => Unused for now
|
||||||
bits: u32,
|
bits: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user