mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
Tablegen support for insert & extract element matching
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46901 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -112,6 +112,10 @@ SDTypeConstraint::SDTypeConstraint(Record *R) {
|
||||
ConstraintType = SDTCisIntVectorOfSameSize;
|
||||
x.SDTCisIntVectorOfSameSize_Info.OtherOperandNum =
|
||||
R->getValueAsInt("OtherOpNum");
|
||||
} else if (R->isSubClassOf("SDTCisEltOfVec")) {
|
||||
ConstraintType = SDTCisEltOfVec;
|
||||
x.SDTCisEltOfVec_Info.OtherOperandNum =
|
||||
R->getValueAsInt("OtherOpNum");
|
||||
} else {
|
||||
cerr << "Unrecognized SDTypeConstraint '" << R->getName() << "'!\n";
|
||||
exit(1);
|
||||
@@ -288,6 +292,19 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N,
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case SDTCisEltOfVec: {
|
||||
TreePatternNode *OtherOperand =
|
||||
getOperandNum(x.SDTCisIntVectorOfSameSize_Info.OtherOperandNum,
|
||||
N, NumResults);
|
||||
if (OtherOperand->hasTypeSet()) {
|
||||
if (!MVT::isVector(OtherOperand->getTypeNum(0)))
|
||||
TP.error(N->getOperator()->getName() + " VT operand must be a vector!");
|
||||
MVT::ValueType IVT = OtherOperand->getTypeNum(0);
|
||||
IVT = MVT::getVectorElementType(IVT);
|
||||
return NodeToApply->UpdateNodeType(IVT, TP);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user