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: RegisterThe kind of register it names.
selection: SelectionWhich components it selects.
components: u8The 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.
modifier: u80 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: u8The minimum-precision annotation of the operand’s extended token (0 none; 1 float16, 2 float2_8, 4 sint16, 5 uint16).
non_uniform: boolThe operand’s extended token marks it as a non-uniform resource index.