diff options
author | Chris Lattner <sabre@nondot.org> | 2005-05-14 05:33:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-05-14 05:33:54 +0000 |
commit | a88a260dbd874a3bdd3e47f4f15ab0d7c7803044 (patch) | |
tree | 8b78fabf1c5895ac4037f1aee4d742db5305b0db /lib | |
parent | eb99a451e87aa330cb4d5710e18a2578fb071049 (diff) | |
download | llvm-a88a260dbd874a3bdd3e47f4f15ab0d7c7803044.tar.gz llvm-a88a260dbd874a3bdd3e47f4f15ab0d7c7803044.tar.bz2 llvm-a88a260dbd874a3bdd3e47f4f15ab0d7c7803044.tar.xz |
Allow targets to have a custom int64->fp expander if desired
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22001 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 91badeb2bd..4702fd422d 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -2176,6 +2176,17 @@ ExpandIntToFP(bool isSigned, MVT::ValueType DestTy, SDOperand Source) { return DAG.getNode(ISD::ADD, DestTy, SignedConv, FudgeInReg); } + // Check to see if the target has a custom way to lower this. If so, use it. + switch (TLI.getOperationAction(ISD::SINT_TO_FP, Source.getValueType())) { + default: assert(0 && "This action not implemented for this operation!"); + case TargetLowering::Legal: + case TargetLowering::Expand: + break; // This case is handled below. + case TargetLowering::Custom: + Source = DAG.getNode(ISD::SINT_TO_FP, DestTy, Source); + return LegalizeOp(TLI.LowerOperation(Source)); + } + // Expand the source, then glue it back together for the call. We must expand // the source in case it is shared (this pass of legalize must traverse it). SDOperand SrcLo, SrcHi; |