pub struct Instruction {
pub word: usize,
pub opcode: u16,
pub control: u32,
pub extensions: Vec<u32>,
pub saturate: bool,
pub nonzero: bool,
pub operands: Vec<Operand>,
}Expand description
An instruction as stored.
Fields§
§word: usizeThe instruction’s first word in the token stream.
opcode: u16The opcode token’s low 11 bits (see opcode_name).
control: u32The opcode token’s bits 11 to 23: saturate and the opcode-specific controls (the test of a conditional, a
resinfo return type, the interpolation of a declaration).
extensions: Vec<u32>The opcode’s extended tokens as stored (sample offsets, resource dimension, return type).
saturate: boolThe saturate bit of the opcode token.
nonzero: boolA conditional (if, breakc, continuec) taken when its operand is nonzero (_nz), else when zero (_z).
operands: Vec<Operand>The operands, destination first where the instruction has one.
Implementations§
Source§impl Instruction
impl Instruction
Sourcepub fn sample_offset(&self) -> Option<[i32; 3]>
pub fn sample_offset(&self) -> Option<[i32; 3]>
The sample offsets of the extended token of kind 1 (_aoffimmi), if the instruction has one.
Sourcepub fn resource_dimension(&self) -> Option<(u32, u32)>
pub fn resource_dimension(&self) -> Option<(u32, u32)>
The resource dimension and structured stride of the extended token of kind 2.
Sourcepub fn return_type(&self) -> Option<u32>
pub fn return_type(&self) -> Option<u32>
The return-type token of the extended token of kind 3 (four nibbles).