Skip to main content

Instruction

Struct Instruction 

Source
pub struct Instruction {
Show 18 fields pub offset: usize, pub words: [u32; 4], pub vector: VectorOpcode, pub scalar: ScalarOpcode, pub sources: [Source; 3], pub input: u8, pub constant: u16, pub input_relative: bool, pub constant_relative: bool, pub address: (u8, u8), pub vector_destination: Destination, pub scalar_destination: Destination, pub vector_mask: u8, pub scalar_mask: u8, pub saturate: bool, pub condition: Condition, pub last: bool, pub unassigned: [u32; 4],
}
Expand description

One 128-bit slot.

Fields§

§offset: usize

The slot’s byte offset in the microcode.

§words: [u32; 4]

The four words as stored (big-endian read), most significant first.

§vector: VectorOpcode

The vector operation.

§scalar: ScalarOpcode

The scalar operation.

§sources: [Source; 3]

The three source operands, shared by both operations.

§input: u8

The attribute index of every source of kind SourceKind::Input.

§constant: u16

The constant index (ten bits) of every source of kind SourceKind::Constant.

§input_relative: bool

Whether attribute sources add the address register to Self::input.

§constant_relative: bool

Whether constant sources add the address register to Self::constant.

§address: (u8, u8)

Which address register and which of its lanes a relative operand adds.

§vector_destination: Destination

Where the vector operation’s result goes.

§scalar_destination: Destination

Where the scalar operation’s result goes.

§vector_mask: u8

The vector operation’s write mask, bit 0 x to bit 3 w.

§scalar_mask: u8

The scalar operation’s write mask, bit 0 x to bit 3 w.

§saturate: bool

Whether results are clamped to 0..1.

§condition: Condition

The condition test.

§last: bool

Whether this is the program’s last instruction.

§unassigned: [u32; 4]

The bits of the four words that no field here covers.

Implementations§

Source§

impl Instruction

Source

pub fn outputs(&self) -> Vec<Output>

The outputs this instruction writes: the destination of each operation that has an output destination and a non-empty write mask.

Trait Implementations§

Source§

impl Clone for Instruction

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 Instruction

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Instruction

Source§

impl PartialEq for Instruction

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Instruction

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.