Basic FastISel support for floating-point constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55401 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/FastISelEmitter.cpp b/utils/TableGen/FastISelEmitter.cpp
index 219b8f3..290676a 100644
--- a/utils/TableGen/FastISelEmitter.cpp
+++ b/utils/TableGen/FastISelEmitter.cpp
@@ -68,6 +68,11 @@
Operands.push_back("i");
return true;
}
+ if (!InstPatNode->isLeaf() &&
+ InstPatNode->getOperator()->getName() == "fpimm") {
+ Operands.push_back("f");
+ return true;
+ }
const CodeGenRegisterClass *DstRC = 0;
@@ -87,6 +92,10 @@
Operands.push_back("i");
return true;
}
+ if (Op->getOperator()->getName() == "fpimm") {
+ Operands.push_back("f");
+ return true;
+ }
// For now, ignore fpimm and other non-leaf nodes.
return false;
}
@@ -122,6 +131,8 @@
OS << "unsigned Op" << i;
} else if (Operands[i] == "i") {
OS << "uint64_t imm" << i;
+ } else if (Operands[i] == "f") {
+ OS << "ConstantFP *f" << i;
} else {
assert("Unknown operand kind!");
abort();
@@ -137,6 +148,8 @@
OS << "Op" << i;
} else if (Operands[i] == "i") {
OS << "imm" << i;
+ } else if (Operands[i] == "f") {
+ OS << "f" << i;
} else {
assert("Unknown operand kind!");
abort();