diff options
author | Nate Begeman <natebegeman@mac.com> | 2008-02-14 08:57:00 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2008-02-14 08:57:00 +0000 |
commit | e179584f9b740cf3a36bde70f8cab40de59b8081 (patch) | |
tree | 154abecd7804f8cb2ee74ced19f41990f9725832 /utils | |
parent | 6e9bceea976a993dbc6a543c2135980df7616b97 (diff) | |
download | external_llvm-e179584f9b740cf3a36bde70f8cab40de59b8081.zip external_llvm-e179584f9b740cf3a36bde70f8cab40de59b8081.tar.gz external_llvm-e179584f9b740cf3a36bde70f8cab40de59b8081.tar.bz2 |
Change how FP immediates are handled.
1) ConstantFP is now expand by default
2) ConstantFP is not turned into TargetConstantFP during Legalize
if it is legal.
This allows ConstantFP to be handled like Constant, allowing for
targets that can encode FP immediates as MachineOperands.
As a bonus, fix up Itanium FP constants, which now correctly match,
and match more constants! Hooray.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47121 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/DAGISelEmitter.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index f74b997..472edbc 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -764,6 +764,18 @@ public: Val = TmpVar; ModifiedVal = true; NodeOps.push_back(Val); + } else if (!N->isLeaf() && N->getOperator()->getName() == "fpimm") { + assert(N->getExtTypes().size() == 1 && "Multiple types not handled!"); + std::string TmpVar = "Tmp" + utostr(ResNo); + emitCode("SDOperand " + TmpVar + + " = CurDAG->getTargetConstantFP(cast<ConstantFPSDNode>(" + + Val + ")->getValueAPF(), cast<ConstantFPSDNode>(" + Val + + ")->getValueType(0));"); + // Add Tmp<ResNo> to VariableMap, so that we don't multiply select this + // value if used multiple times by this pattern result. + Val = TmpVar; + ModifiedVal = true; + NodeOps.push_back(Val); } else if (!N->isLeaf() && N->getOperator()->getName() == "texternalsym"){ Record *Op = OperatorMap[N->getName()]; // Transform ExternalSymbol to TargetExternalSymbol @@ -1889,6 +1901,7 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { << " case ISD::Register:\n" << " case ISD::HANDLENODE:\n" << " case ISD::TargetConstant:\n" + << " case ISD::TargetConstantFP:\n" << " case ISD::TargetConstantPool:\n" << " case ISD::TargetFrameIndex:\n" << " case ISD::TargetExternalSymbol:\n" |