[][src]Enum llhd::ir::InstData

pub enum InstData {
    ConstInt {
        opcode: Opcode,
        imm: IntValue,
    },
    ConstTime {
        opcode: Opcode,
        imm: TimeValue,
    },
    Array {
        opcode: Opcode,
        imms: [usize; 1],
        args: [Value; 1],
    },
    Aggregate {
        opcode: Opcode,
        args: Vec<Value>,
    },
    Nullary {
        opcode: Opcode,
    },
    Unary {
        opcode: Opcode,
        args: [Value; 1],
    },
    Binary {
        opcode: Opcode,
        args: [Value; 2],
    },
    Ternary {
        opcode: Opcode,
        args: [Value; 3],
    },
    Quaternary {
        opcode: Opcode,
        args: [Value; 4],
    },
    Jump {
        opcode: Opcode,
        bbs: [Block; 1],
    },
    Phi {
        opcode: Opcode,
        args: Vec<Value>,
        bbs: Vec<Block>,
    },
    Branch {
        opcode: Opcode,
        args: [Value; 1],
        bbs: [Block; 2],
    },
    Wait {
        opcode: Opcode,
        bbs: [Block; 1],
        args: Vec<Value>,
    },
    Call {
        opcode: Opcode,
        unit: ExtUnit,
        ins: u16,
        args: Vec<Value>,
    },
    InsExt {
        opcode: Opcode,
        args: [Value; 2],
        imms: [usize; 2],
    },
    Reg {
        opcode: Opcode,
        args: Vec<Value>,
        modes: Vec<RegMode>,
    },
}

An instruction format.

Variants

ConstInt

a = const iN imm

Fields of ConstInt

opcode: Opcodeimm: IntValue
ConstTime

a = const time imm

Fields of ConstTime

opcode: Opcodeimm: TimeValue
Array

opcode imm, type x

Fields of Array

opcode: Opcodeimms: [usize; 1]args: [Value; 1]
Aggregate

opcode args

Fields of Aggregate

opcode: Opcodeargs: Vec<Value>
Nullary

opcode

Fields of Nullary

opcode: Opcode
Unary

opcode type x

Fields of Unary

opcode: Opcodeargs: [Value; 1]
Binary

opcode type x, y

Fields of Binary

opcode: Opcodeargs: [Value; 2]
Ternary

opcode type x, y, z

Fields of Ternary

opcode: Opcodeargs: [Value; 3]
Quaternary

opcode type x, y, z, w

Fields of Quaternary

opcode: Opcodeargs: [Value; 4]
Jump

opcode bb

Fields of Jump

opcode: Opcodebbs: [Block; 1]
Phi

opcode type [x, bb],*

Fields of Phi

opcode: Opcodeargs: Vec<Value>bbs: Vec<Block>
Branch

opcode x, bb0, bb1

Fields of Branch

opcode: Opcodeargs: [Value; 1]bbs: [Block; 2]
Wait

opcode bb, args

Fields of Wait

opcode: Opcodebbs: [Block; 1]args: Vec<Value>
Call

a = opcode type unit (inputs) -> (outputs)

Fields of Call

opcode: Opcodeunit: ExtUnitins: u16args: Vec<Value>
InsExt

a = opcode type x, y, imm0, imm1

Fields of InsExt

opcode: Opcodeargs: [Value; 2]imms: [usize; 2]
Reg

a = reg type x (, data mode trigger)*

Fields of Reg

opcode: Opcodeargs: Vec<Value>modes: Vec<RegMode>

Methods

impl InstData[src]

pub fn opcode(&self) -> Opcode[src]

Get the opcode of the instruction.

pub fn args(&self) -> &[Value][src]

Get the arguments of an instruction.

pub fn imms(&self) -> &[usize][src]

Get the immediates of an instruction.

pub fn input_args(&self) -> &[Value][src]

Get the input arguments of a call instruction.

pub fn output_args(&self) -> &[Value][src]

Get the output arguments of a call instruction.

pub fn data_args(&self) -> impl Iterator<Item = Value> + '_[src]

Get the data arguments of a register instruction.

pub fn trigger_args(&self) -> impl Iterator<Item = Value> + '_[src]

Get the trigger arguments of a register instruction.

pub fn gating_args(&self) -> impl Iterator<Item = Option<Value>> + '_[src]

Get the gating arguments of a register instruction.

pub fn mode_args(&self) -> impl Iterator<Item = RegMode> + '_[src]

Get the modes of a register instruction.

pub fn triggers(&self) -> impl Iterator<Item = RegTrigger> + '_[src]

Get the register triggers.

pub fn blocks(&self) -> &[Block][src]

Get the BBs of an instruction.

pub fn get_const_int(&self) -> Option<&IntValue>[src]

Return the const int constructed by this instruction.

pub fn get_const_time(&self) -> Option<&TimeValue>[src]

Return the const time constructed by this instruction.

pub fn get_ext_unit(&self) -> Option<ExtUnit>[src]

Return the external unit being called or instantiated by this instruction.

Trait Implementations

impl Clone for InstData[src]

impl Debug for InstData[src]

impl Default for InstData[src]

impl<'de> Deserialize<'de> for InstData[src]

impl Eq for InstData[src]

impl Hash for InstData[src]

impl PartialEq<InstData> for InstData[src]

impl Serialize for InstData[src]

impl StructuralEq for InstData[src]

impl StructuralPartialEq for InstData[src]

Auto Trait Implementations

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<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.