================ @@ -1976,4 +1976,28 @@ def VecCreateOp : CIR_Op<"vec.create", [Pure]> { let hasVerifier = 1; } +//===----------------------------------------------------------------------===// +// VecExtractOp +//===----------------------------------------------------------------------===// + +def VecExtractOp : CIR_Op<"vec.extract", [Pure, + TypesMatchWith<"type of 'result' matches element type of 'vec'", "vec", + "result", "cast<VectorType>($_self).getElementType()">]> { + + let summary = "Extract one element from a vector object"; + let description = [{ + The `cir.vec.extract` operation extracts the element at the given index + from a vector object. + }]; + + let arguments = (ins CIR_VectorType:$vec, CIR_AnyFundamentalIntType:$index); + let results = (outs CIR_AnyType:$result); + + let assemblyFormat = [{ + $vec `[` $index `:` type($index) `]` attr-dict `:` qualified(type($vec)) + }]; + + let hasVerifier = 0; ---------------- xlauko wrote:
nit: this is implicit ```suggestion ``` https://github.com/llvm/llvm-project/pull/138413 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits