1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Allow targets to have a custom int64->fp expander if desired

llvm-svn: 22001
This commit is contained in:
Chris Lattner 2005-05-14 05:33:54 +00:00
parent db4f239e62
commit 1202c26d6e

View File

@ -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;