[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp DAGISelEmitter.h
Chris Lattner
lattner at cs.uiuc.edu
Sun Mar 19 21:39:59 PST 2006
Changes in directory llvm/utils/TableGen:
DAGISelEmitter.cpp updated: 1.176 -> 1.177
DAGISelEmitter.h updated: 1.57 -> 1.58
---
Log message:
Add a new SDTCisIntVectorOfSameSize type constraint
---
Diffs of the changes: (+23 -3)
DAGISelEmitter.cpp | 21 +++++++++++++++++++--
DAGISelEmitter.h | 5 ++++-
2 files changed, 23 insertions(+), 3 deletions(-)
Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.176 llvm/utils/TableGen/DAGISelEmitter.cpp:1.177
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.176 Thu Mar 9 02:19:11 2006
+++ llvm/utils/TableGen/DAGISelEmitter.cpp Sun Mar 19 23:39:47 2006
@@ -63,14 +63,14 @@
/// isExtIntegerVT - Return true if the specified extended value type vector
/// contains isInt or an integer value type.
-static bool isExtIntegerInVTs(std::vector<unsigned char> EVTs) {
+static bool isExtIntegerInVTs(const std::vector<unsigned char> &EVTs) {
assert(!EVTs.empty() && "Cannot check for integer in empty ExtVT list!");
return EVTs[0] == MVT::isInt || !(FilterEVTs(EVTs, MVT::isInteger).empty());
}
/// isExtFloatingPointVT - Return true if the specified extended value type
/// vector contains isFP or a FP value type.
-static bool isExtFloatingPointInVTs(std::vector<unsigned char> EVTs) {
+static bool isExtFloatingPointInVTs(const std::vector<unsigned char> &EVTs) {
assert(!EVTs.empty() && "Cannot check for integer in empty ExtVT list!");
return EVTs[0] == MVT::isFP ||
!(FilterEVTs(EVTs, MVT::isFloatingPoint).empty());
@@ -103,6 +103,10 @@
ConstraintType = SDTCisOpSmallerThanOp;
x.SDTCisOpSmallerThanOp_Info.BigOperandNum =
R->getValueAsInt("BigOperandNum");
+ } else if (R->isSubClassOf("SDTCisIntVectorOfSameSize")) {
+ ConstraintType = SDTCisIntVectorOfSameSize;
+ x.SDTCisIntVectorOfSameSize_Info.OtherOperandNum =
+ R->getValueAsInt("OtherOpNum");
} else {
std::cerr << "Unrecognized SDTypeConstraint '" << R->getName() << "'!\n";
exit(1);
@@ -259,6 +263,19 @@
}
return MadeChange;
}
+ case SDTCisIntVectorOfSameSize: {
+ 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::getIntVectorWithNumElements(MVT::getVectorNumElements(IVT));
+ return NodeToApply->UpdateNodeType(IVT, TP);
+ }
+ return false;
+ }
}
return false;
}
Index: llvm/utils/TableGen/DAGISelEmitter.h
diff -u llvm/utils/TableGen/DAGISelEmitter.h:1.57 llvm/utils/TableGen/DAGISelEmitter.h:1.58
--- llvm/utils/TableGen/DAGISelEmitter.h:1.57 Thu Feb 9 01:16:09 2006
+++ llvm/utils/TableGen/DAGISelEmitter.h Sun Mar 19 23:39:48 2006
@@ -47,7 +47,7 @@
unsigned OperandNo; // The operand # this constraint applies to.
enum {
SDTCisVT, SDTCisPtrTy, SDTCisInt, SDTCisFP, SDTCisSameAs,
- SDTCisVTSmallerThanOp, SDTCisOpSmallerThanOp
+ SDTCisVTSmallerThanOp, SDTCisOpSmallerThanOp, SDTCisIntVectorOfSameSize
} ConstraintType;
union { // The discriminated union.
@@ -63,6 +63,9 @@
struct {
unsigned BigOperandNum;
} SDTCisOpSmallerThanOp_Info;
+ struct {
+ unsigned OtherOperandNum;
+ } SDTCisIntVectorOfSameSize_Info;
} x;
/// ApplyTypeConstraint - Given a node in a pattern, apply this type
More information about the llvm-commits
mailing list