[−][src]Struct llhd::ir::InstBuilder
A temporary object used to construct a single instruction.
Methods
impl<'a, 'b> InstBuilder<'a, 'b>
[src]
pub fn new(builder: &'b mut UnitBuilder<'a>) -> Self
[src]
Create a new instruction builder that inserts into builder
.
pub fn name(self, name: impl Into<String>) -> Self
[src]
Assign a name to the instruction being built.
impl<'a, 'b> InstBuilder<'a, 'b>
[src]
pub fn const_zero(&mut self, ty: &Type) -> Value
[src]
Construct the zero value for a type.
This is a convenience function that creates the appropriate instruction sequence to generate the given zero value. Note that arrays and structs emit multiple instructions.
pub fn const_int(&mut self, value: impl Into<IntValue>) -> Value
[src]
pub fn const_time(&mut self, value: impl Into<TimeValue>) -> Value
[src]
pub fn alias(&mut self, x: Value) -> Value
[src]
pub fn array_uniform(&mut self, imm: usize, x: Value) -> Value
[src]
pub fn array(&mut self, args: Vec<Value>) -> Value
[src]
pub fn strukt(&mut self, args: Vec<Value>) -> Value
[src]
pub fn not(&mut self, x: Value) -> Value
[src]
pub fn neg(&mut self, x: Value) -> Value
[src]
pub fn add(&mut self, x: Value, y: Value) -> Value
[src]
pub fn sub(&mut self, x: Value, y: Value) -> Value
[src]
pub fn and(&mut self, x: Value, y: Value) -> Value
[src]
pub fn or(&mut self, x: Value, y: Value) -> Value
[src]
pub fn xor(&mut self, x: Value, y: Value) -> Value
[src]
pub fn smul(&mut self, x: Value, y: Value) -> Value
[src]
pub fn sdiv(&mut self, x: Value, y: Value) -> Value
[src]
pub fn smod(&mut self, x: Value, y: Value) -> Value
[src]
pub fn srem(&mut self, x: Value, y: Value) -> Value
[src]
pub fn umul(&mut self, x: Value, y: Value) -> Value
[src]
pub fn udiv(&mut self, x: Value, y: Value) -> Value
[src]
pub fn umod(&mut self, x: Value, y: Value) -> Value
[src]
pub fn urem(&mut self, x: Value, y: Value) -> Value
[src]
pub fn eq(&mut self, x: Value, y: Value) -> Value
[src]
pub fn neq(&mut self, x: Value, y: Value) -> Value
[src]
pub fn slt(&mut self, x: Value, y: Value) -> Value
[src]
pub fn sgt(&mut self, x: Value, y: Value) -> Value
[src]
pub fn sle(&mut self, x: Value, y: Value) -> Value
[src]
pub fn sge(&mut self, x: Value, y: Value) -> Value
[src]
pub fn ult(&mut self, x: Value, y: Value) -> Value
[src]
pub fn ugt(&mut self, x: Value, y: Value) -> Value
[src]
pub fn ule(&mut self, x: Value, y: Value) -> Value
[src]
pub fn uge(&mut self, x: Value, y: Value) -> Value
[src]
pub fn shl(&mut self, x: Value, y: Value, z: Value) -> Value
[src]
pub fn shr(&mut self, x: Value, y: Value, z: Value) -> Value
[src]
pub fn mux(&mut self, x: Value, y: Value) -> Value
[src]
pub fn reg(&mut self, x: Value, data: Vec<RegTrigger>) -> Inst
[src]
pub fn ins_field(&mut self, x: Value, y: Value, imm: usize) -> Value
[src]
pub fn ins_slice(
&mut self,
x: Value,
y: Value,
imm0: usize,
imm1: usize
) -> Value
[src]
&mut self,
x: Value,
y: Value,
imm0: usize,
imm1: usize
) -> Value
pub fn ext_field(&mut self, x: Value, imm: usize) -> Value
[src]
pub fn ext_slice(&mut self, x: Value, imm0: usize, imm1: usize) -> Value
[src]
pub fn con(&mut self, x: Value, y: Value) -> Inst
[src]
pub fn del(&mut self, target: Value, source: Value, delay: Value) -> Inst
[src]
pub fn call(&mut self, unit: ExtUnit, args: Vec<Value>) -> Inst
[src]
pub fn inst(
&mut self,
unit: ExtUnit,
inputs: Vec<Value>,
outputs: Vec<Value>
) -> Inst
[src]
&mut self,
unit: ExtUnit,
inputs: Vec<Value>,
outputs: Vec<Value>
) -> Inst
pub fn sig(&mut self, x: Value) -> Value
[src]
pub fn prb(&mut self, x: Value) -> Value
[src]
pub fn drv(&mut self, signal: Value, value: Value, delay: Value) -> Inst
[src]
pub fn drv_cond(
&mut self,
signal: Value,
value: Value,
delay: Value,
cond: Value
) -> Inst
[src]
&mut self,
signal: Value,
value: Value,
delay: Value,
cond: Value
) -> Inst
pub fn var(&mut self, x: Value) -> Value
[src]
pub fn ld(&mut self, x: Value) -> Value
[src]
pub fn st(&mut self, x: Value, y: Value) -> Inst
[src]
pub fn halt(&mut self) -> Inst
[src]
pub fn ret(&mut self) -> Inst
[src]
pub fn ret_value(&mut self, x: Value) -> Inst
[src]
pub fn phi(&mut self, args: Vec<Value>, bbs: Vec<Block>) -> Value
[src]
pub fn br(&mut self, bb: Block) -> Inst
[src]
pub fn br_cond(&mut self, x: Value, bb0: Block, bb1: Block) -> Inst
[src]
pub fn wait(&mut self, bb: Block, args: Vec<Value>) -> Inst
[src]
pub fn wait_time(&mut self, bb: Block, time: Value, args: Vec<Value>) -> Inst
[src]
impl<'a, 'b> InstBuilder<'a, 'b>
[src]
Fundamental convenience forwards to the wrapped builder.
pub fn suffix<'c>(self, value: Value, suffix: impl Into<Cow<'c, str>>) -> Self
[src]
Assign another value's name plus a suffix to the instruction being built.
If value
has a name, the instruction's name will be
<value>.<suffix>
. Otherwise it will just be <suffix>
.
Auto Trait Implementations
impl<'a, 'b> RefUnwindSafe for InstBuilder<'a, 'b>
impl<'a, 'b> Send for InstBuilder<'a, 'b>
impl<'a, 'b> Sync for InstBuilder<'a, 'b>
impl<'a, 'b> Unpin for InstBuilder<'a, 'b> where
'a: 'b,
'a: 'b,
impl<'a, 'b> !UnwindSafe for InstBuilder<'a, 'b>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,