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 | d3cc996a4744efc97e92db4df80ce89e0621e89d (patch) | |
tree | eea34bbba175af7b486be5144128cebd6f117ab2 /llvm/lib | |
parent | b42e8723b0a67bb4d50da8c3edc4985fcce4ab68 (diff) | |
download | bcm5719-llvm-d3cc996a4744efc97e92db4df80ce89e0621e89d.tar.gz bcm5719-llvm-d3cc996a4744efc97e92db4df80ce89e0621e89d.zip |
Allow targets to have a custom int64->fp expander if desired
llvm-svn: 22001
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 91badeb2bdf..4702fd422dc 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/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; |