pub struct ExtractElementOperation<'c> { /* private fields */ }
Expand description
An extractelement
operation. Extractelement operation.
Takes a 0-D or 1-D vector and a optional dynamic index position and extracts the scalar at that position.
Note that this instruction resembles vector.extract, but is restricted to 0-D and 1-D vectors and relaxed to dynamic indices. If the vector is 0-D, the position must be std::nullopt.
It is meant to be closer to LLVM’s version: https://llvm.org/docs/LangRef.html#extractelement-instruction
Example:
%c = arith.constant 15 : i32
%1 = vector.extractelement %0[%c : i32]: vector<16xf32>
%2 = vector.extractelement %z[]: vector<f32>
Implementations§
source§impl<'c> ExtractElementOperation<'c>
impl<'c> ExtractElementOperation<'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>
) -> ExtractElementOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ExtractElementOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn vector(&self) -> Result<Value<'c, '_>, Error>
pub fn position(&self) -> Result<Value<'c, '_>, Error>
Trait Implementations§
source§impl<'c> From<ExtractElementOperation<'c>> for Operation<'c>
impl<'c> From<ExtractElementOperation<'c>> for Operation<'c>
source§fn from(operation: ExtractElementOperation<'c>) -> Self
fn from(operation: ExtractElementOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ExtractElementOperation<'c>
impl<'c> !Send for ExtractElementOperation<'c>
impl<'c> !Sync for ExtractElementOperation<'c>
impl<'c> Unpin for ExtractElementOperation<'c>
impl<'c> UnwindSafe for ExtractElementOperation<'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