Skip to main content

Operand

Struct Operand 

Source
pub struct Operand {
    pub register: Register,
    pub selection: Selection,
    pub components: u8,
    pub indices: Vec<Index>,
    pub immediate: [u32; 4],
    pub modifier: u8,
    pub precision: u8,
    pub non_uniform: bool,
}
Expand description

An instruction’s or declaration’s operand.

Fields§

§register: Register

The kind of register it names.

§selection: Selection

Which components it selects.

§components: u8

The number of components the operand token states (0, 1 or 4): a one-component operand (oDepth, l(1.0)) and a four-component register selecting one lane (r0.x) both have a Selection::Scalar.

§indices: Vec<Index>

Its index dimensions, outermost first: none for an immediate, one for r3, two for cb2[5].

§immediate: [u32; 4]

The values of an immediate operand (one lane repeated, or four); zero for other registers. A 64-bit immediate’s four words are two doubles, low word first; one of one component is a single word repeated, as Microsoft’s disassembler reads it (fxc writes none).

§modifier: u8

0 none, 1 negate, 2 absolute, 3 negated absolute (float sources); 4 two’s-complement negate (an integer instruction’s negate; the encoding has no such value, so a caller that knows the instruction reads integers sets it).

§precision: u8

The minimum-precision annotation of the operand’s extended token (0 none; 1 float16, 2 float2_8, 4 sint16, 5 uint16).

§non_uniform: bool

The operand’s extended token marks it as a non-uniform resource index.

Trait Implementations§

Source§

impl Clone for Operand

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Operand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.