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

pub enum InstData {
    ConstInt {
        opcode: Opcode,
        imm: BigInt,
    },
    ConstTime {
        opcode: Opcode,
        imm: ConstTime,
    },
    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],
    },
    Jump {
        opcode: Opcode,
        bbs: [Block; 1],
    },
    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: BigInt
ConstTime

a = const time imm

Fields of ConstTime

opcode: Opcodeimm: ConstTime
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]
Jump

opcode bb

Fields of Jump

opcode: Opcodebbs: [Block; 1]
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 args_mut(&mut self) -> &mut [Value][src]

Mutable access to 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) -> &[Value][src]

Get the data arguments of a register instruction.

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

Get the trigger arguments of a register instruction.

pub fn mode_args(&self) -> &[RegMode][src]

Get the modes of a register instruction.

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

Get the BBs of an instruction.

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

Mutable access to the BBs of an instruction.

pub fn replace_value(&mut self, from: Value, to: Value) -> usize[src]

Replace all uses of a value with another.

pub fn replace_block(&mut self, from: Block, to: Block) -> usize[src]

Replace all uses of a block with another.

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

Return the const int constructed by this instruction.

pub fn get_const_time(&self) -> Option<&ConstTime>[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]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for 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.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]