forked from OSchip/llvm-project
[LegalizeTypes] In SoftenFloatRes_FNEG, always generate integer arithmetic, never fall back to using fsub.
We would previously fallback if the type wasn't f32/f64/f128. But I don't think any of the other floating point types ever go through the softening code anyway. So this code is dead.
This commit is contained in:
parent
2485fa7739
commit
68ddf434c0
|
@ -452,25 +452,10 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FNEG(SDNode *N) {
|
||||||
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
|
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
|
||||||
SDLoc dl(N);
|
SDLoc dl(N);
|
||||||
|
|
||||||
EVT FloatVT = N->getValueType(0);
|
// Expand Y = FNEG(X) -> Y = X ^ sign mask
|
||||||
if (FloatVT == MVT::f32 || FloatVT == MVT::f64 || FloatVT == MVT::f128) {
|
APInt SignMask = APInt::getSignMask(NVT.getSizeInBits());
|
||||||
// Expand Y = FNEG(X) -> Y = X ^ sign mask
|
return DAG.getNode(ISD::XOR, dl, NVT, GetSoftenedFloat(N->getOperand(0)),
|
||||||
APInt SignMask = APInt::getSignMask(NVT.getSizeInBits());
|
DAG.getConstant(SignMask, dl, NVT));
|
||||||
return DAG.getNode(ISD::XOR, dl, NVT, GetSoftenedFloat(N->getOperand(0)),
|
|
||||||
DAG.getConstant(SignMask, dl, NVT));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Expand Y = FNEG(X) -> Y = SUB -0.0, X
|
|
||||||
SDValue Ops[2] = { DAG.getConstantFP(-0.0, dl, N->getValueType(0)),
|
|
||||||
GetSoftenedFloat(N->getOperand(0)) };
|
|
||||||
TargetLowering::MakeLibCallOptions CallOptions;
|
|
||||||
return TLI.makeLibCall(DAG, GetFPLibCall(N->getValueType(0),
|
|
||||||
RTLIB::SUB_F32,
|
|
||||||
RTLIB::SUB_F64,
|
|
||||||
RTLIB::SUB_F80,
|
|
||||||
RTLIB::SUB_F128,
|
|
||||||
RTLIB::SUB_PPCF128),
|
|
||||||
NVT, Ops, CallOptions, dl).first;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SDValue DAGTypeLegalizer::SoftenFloatRes_FP_EXTEND(SDNode *N) {
|
SDValue DAGTypeLegalizer::SoftenFloatRes_FP_EXTEND(SDNode *N) {
|
||||||
|
|
Loading…
Reference in New Issue