mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
[DAG] SelectionDAGLegalize::ExpandLegalINT_TO_FP - use getFPExtendOrRound helper. NFCI.
Handles SrcVT == DstVT as well. llvm-svn: 343121
This commit is contained in:
parent
bc87e250e3
commit
0678fedbb1
@ -2350,17 +2350,7 @@ SDValue SelectionDAGLegalize::ExpandLegalINT_TO_FP(bool isSigned, SDValue Op0,
|
||||
// subtract the bias
|
||||
SDValue Sub = DAG.getNode(ISD::FSUB, dl, MVT::f64, Load, Bias);
|
||||
// final result
|
||||
SDValue Result;
|
||||
// handle final rounding
|
||||
if (DestVT == MVT::f64) {
|
||||
// do nothing
|
||||
Result = Sub;
|
||||
} else if (DestVT.bitsLT(MVT::f64)) {
|
||||
Result = DAG.getNode(ISD::FP_ROUND, dl, DestVT, Sub,
|
||||
DAG.getIntPtrConstant(0, dl));
|
||||
} else if (DestVT.bitsGT(MVT::f64)) {
|
||||
Result = DAG.getNode(ISD::FP_EXTEND, dl, DestVT, Sub);
|
||||
}
|
||||
SDValue Result = DAG.getFPExtendOrRound(Sub, dl, DestVT);
|
||||
return Result;
|
||||
}
|
||||
assert(!isSigned && "Legalize cannot Expand SINT_TO_FP for i64 yet");
|
||||
|
Loading…
Reference in New Issue
Block a user