pub struct InsertElementOperation<'c> { /* private fields */ }
Expand description
An insertelement
operation. Insertelement operation.
Takes a scalar source, a 0-D or 1-D destination vector and a dynamic index position and inserts the source into the destination at the proper position.
Note that this instruction resembles vector.insert, but is restricted to 0-D and 1-D vectors and relaxed to dynamic indices.
It is meant to be closer to LLVM’s version: https://llvm.org/docs/LangRef.html#insertelement-instruction
Example:
%c = arith.constant 15 : i32
%f = arith.constant 0.0f : f32
%1 = vector.insertelement %f, %0[%c : i32]: vector<16xf32>
%2 = vector.insertelement %f, %z[]: vector<f32>
Implementations§
source§impl<'c> InsertElementOperation<'c>
impl<'c> InsertElementOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> InsertElementOperationBuilder<'c, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> InsertElementOperationBuilder<'c, Unset, Unset, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn source(&self) -> Result<Value<'c, '_>, Error>
pub fn dest(&self) -> Result<Value<'c, '_>, Error>
pub fn position(&self) -> Result<Value<'c, '_>, Error>
Trait Implementations§
source§impl<'c> From<InsertElementOperation<'c>> for Operation<'c>
impl<'c> From<InsertElementOperation<'c>> for Operation<'c>
source§fn from(operation: InsertElementOperation<'c>) -> Self
fn from(operation: InsertElementOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for InsertElementOperation<'c>
impl<'c> !Send for InsertElementOperation<'c>
impl<'c> !Sync for InsertElementOperation<'c>
impl<'c> Unpin for InsertElementOperation<'c>
impl<'c> UnwindSafe for InsertElementOperation<'c>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more