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.
llvm-svn: 173445
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index b1d3a5b..fcee93a 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -935,6 +935,7 @@
break;
}
+ case ADD:
case SHL:
case SRA:
case SRL: {
@@ -945,6 +946,7 @@
int64_t Result;
switch (getOpcode()) {
default: llvm_unreachable("Bad opcode!");
+ case ADD: Result = LHSv + RHSv; break;
case SHL: Result = LHSv << RHSv; break;
case SRA: Result = LHSv >> RHSv; break;
case SRL: Result = (uint64_t)LHSv >> (uint64_t)RHSv; break;
@@ -970,6 +972,7 @@
std::string Result;
switch (Opc) {
case CONCAT: Result = "!con"; break;
+ case ADD: Result = "!add"; break;
case SHL: Result = "!shl"; break;
case SRA: Result = "!sra"; break;
case SRL: Result = "!srl"; break;