Struct cranelift_codegen::machinst::valueregs::ValueRegs[][src]

pub struct ValueRegs<R: Clone + Copy + Debug + PartialEq + Eq + InvalidSentinel> { /* fields omitted */ }

Location at which a Value is stored in register(s): the value is located in one or more registers, depending on its width. A value may be stored in more than one register if the machine has no registers wide enough otherwise: for example, on a 32-bit architecture, we may store I64 values in two registers, and I128 values in four.

By convention, the register parts are kept in machine-endian order here.

N.B.: we cap the capacity of this at four (when any 32-bit target is enabled) or two (otherwise), and we use special in-band sentinal Reg values (Reg::invalid()) to avoid the need to carry a separate length. This allows the struct to be Copy (no heap or drop overhead) and be only 16 or 8 bytes, which is important for compiler performance.

Implementations

impl<R: Clone + Copy + Debug + PartialEq + Eq + InvalidSentinel> ValueRegs<R>[src]

pub fn invalid() -> Self[src]

Create an invalid Value-in-Reg.

pub fn is_valid(self) -> bool[src]

Is this Value-to-Reg mapping valid?

pub fn is_invalid(self) -> bool[src]

Is this Value-to-Reg mapping invalid?

pub fn only_reg(self) -> Option<R>[src]

Return the single register used for this value, if any.

pub fn regs(&self) -> &[R][src]

Return an iterator over the registers storing this value.

impl<R: Clone + Copy + Debug + PartialEq + Eq + InvalidSentinel> ValueRegs<R>[src]

pub fn one(reg: R) -> Self[src]

Create a Value-in-R location for a value stored in one register.

pub fn two(r1: R, r2: R) -> Self[src]

Create a Value-in-R location for a value stored in two registers.

pub fn len(self) -> usize[src]

Return the number of registers used.

pub fn map<NewR, F>(self, f: F) -> ValueRegs<NewR> where
    NewR: Clone + Copy + Debug + PartialEq + Eq + InvalidSentinel,
    F: Fn(R) -> NewR, 
[src]

Map individual registers via a map function.

Trait Implementations

impl<R: Clone + Copy + Debug + PartialEq + Eq + InvalidSentinel> Clone for ValueRegs<R>[src]

impl<R: Copy + Clone + Debug + PartialEq + Eq + InvalidSentinel> Copy for ValueRegs<R>[src]

impl<R: Debug + Clone + Copy + PartialEq + Eq + InvalidSentinel> Debug for ValueRegs<R>[src]

impl<R: Eq + Clone + Copy + Debug + PartialEq + InvalidSentinel> Eq for ValueRegs<R>[src]

impl<R: PartialEq + Clone + Copy + Debug + Eq + InvalidSentinel> PartialEq<ValueRegs<R>> for ValueRegs<R>[src]

impl<R: Clone + Copy + Debug + PartialEq + Eq + InvalidSentinel> StructuralEq for ValueRegs<R>[src]

impl<R: Clone + Copy + Debug + PartialEq + Eq + InvalidSentinel> StructuralPartialEq for ValueRegs<R>[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for ValueRegs<R> where
    R: RefUnwindSafe

impl<R> Send for ValueRegs<R> where
    R: Send

impl<R> Sync for ValueRegs<R> where
    R: Sync

impl<R> Unpin for ValueRegs<R> where
    R: Unpin

impl<R> UnwindSafe for ValueRegs<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.