aboutsummaryrefslogtreecommitdiff
path: root/lib/TableGen/TGParser.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-01-25 14:49:08 +0000
committerHal Finkel <hfinkel@anl.gov>2013-01-25 14:49:08 +0000
commitd23a41c153712b929bd84f5e713bda5db5d6e66d (patch)
tree0510f2d72a79dbbdb6f6db2438d4b7ea3006da3c /lib/TableGen/TGParser.cpp
parent4a9256f265a7fcccd1f04518b55fd751f3a920a8 (diff)
Add an addition operator to TableGen
This adds an !add(a, b) operator to tablegen; this will be used to cleanup the PPC register definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173445 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/TableGen/TGParser.cpp')
-rw-r--r--lib/TableGen/TGParser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp
index 8ee3a7b4ec..da0086a74a 100644
--- a/lib/TableGen/TGParser.cpp
+++ b/lib/TableGen/TGParser.cpp
@@ -912,6 +912,7 @@ Init *TGParser::ParseOperation(Record *CurRec) {
}
case tgtok::XConcat:
+ case tgtok::XADD:
case tgtok::XSRA:
case tgtok::XSRL:
case tgtok::XSHL:
@@ -927,6 +928,7 @@ Init *TGParser::ParseOperation(Record *CurRec) {
switch (OpTok) {
default: llvm_unreachable("Unhandled code!");
case tgtok::XConcat: Code = BinOpInit::CONCAT;Type = DagRecTy::get(); break;
+ case tgtok::XADD: Code = BinOpInit::ADD; Type = IntRecTy::get(); break;
case tgtok::XSRA: Code = BinOpInit::SRA; Type = IntRecTy::get(); break;
case tgtok::XSRL: Code = BinOpInit::SRL; Type = IntRecTy::get(); break;
case tgtok::XSHL: Code = BinOpInit::SHL; Type = IntRecTy::get(); break;
@@ -1142,6 +1144,7 @@ RecTy *TGParser::ParseOperatorType() {
/// SimpleValue ::= '[' ValueList ']'
/// SimpleValue ::= '(' IDValue DagArgList ')'
/// SimpleValue ::= CONCATTOK '(' Value ',' Value ')'
+/// SimpleValue ::= ADDTOK '(' Value ',' Value ')'
/// SimpleValue ::= SHLTOK '(' Value ',' Value ')'
/// SimpleValue ::= SRATOK '(' Value ',' Value ')'
/// SimpleValue ::= SRLTOK '(' Value ',' Value ')'
@@ -1397,6 +1400,7 @@ Init *TGParser::ParseSimpleValue(Record *CurRec, RecTy *ItemType,
case tgtok::XEmpty:
case tgtok::XCast: // Value ::= !unop '(' Value ')'
case tgtok::XConcat:
+ case tgtok::XADD:
case tgtok::XSRA:
case tgtok::XSRL:
case tgtok::XSHL: