[llvm] [AArch64] Add @llvm.experimental.vector.match (PR #101974)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 15 05:08:09 PDT 2024
================
@@ -6255,6 +6255,58 @@ SDValue AArch64TargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
DAG.getNode(AArch64ISD::CTTZ_ELTS, dl, MVT::i64, CttzOp);
return DAG.getZExtOrTrunc(NewCttzElts, dl, Op.getValueType());
}
+ case Intrinsic::experimental_vector_match: {
+ SDValue ID =
+ DAG.getTargetConstant(Intrinsic::aarch64_sve_match, dl, MVT::i64);
+
+ auto Op1 = Op.getOperand(1);
+ auto Op2 = Op.getOperand(2);
+ auto Mask = Op.getOperand(3);
+
+ EVT Op1VT = Op1.getValueType();
+ EVT Op2VT = Op2.getValueType();
+ EVT ResVT = Op.getValueType();
+
+ assert((Op1VT.getVectorElementType() == MVT::i8 ||
+ Op1VT.getVectorElementType() == MVT::i16) &&
+ "Expected 8-bit or 16-bit characters.");
+ assert(!Op2VT.isScalableVector() && "Search vector cannot be scalable.");
+ assert(Op1VT.getVectorElementType() == Op2VT.getVectorElementType() &&
+ "Operand type mismatch.");
+ assert(Op1VT.getVectorMinNumElements() == Op2VT.getVectorNumElements() &&
+ "Invalid operands.");
+
+ // Wrap the search vector in a scalable vector.
+ EVT OpContainerVT = getContainerForFixedLengthVector(DAG, Op2VT);
----------------
david-arm wrote:
Maybe worth renaming this to be `Op2ContainerVT` for clarity?
https://github.com/llvm/llvm-project/pull/101974
More information about the llvm-commits
mailing list