Skip to content

Commit 9169c5f

Browse files
[SelectionDAG] Only lower COPYSIGN for ppcf128 to copysignl
All other floats are expanded for all current architectures just fine. PowerPC, however, does not efficiently legalize its very own float.
1 parent 03ee6b6 commit 9169c5f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,12 +1709,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FCEIL(SDNode *N,
17091709

17101710
void DAGTypeLegalizer::ExpandFloatRes_FCOPYSIGN(SDNode *N,
17111711
SDValue &Lo, SDValue &Hi) {
1712-
ExpandFloatRes_Binary(N, GetFPLibCall(N->getValueType(0),
1713-
RTLIB::COPYSIGN_F32,
1714-
RTLIB::COPYSIGN_F64,
1715-
RTLIB::COPYSIGN_F80,
1716-
RTLIB::COPYSIGN_F128,
1717-
RTLIB::COPYSIGN_PPCF128), Lo, Hi);
1712+
1713+
EVT VT = N->getValueType(0);
1714+
ExpandFloatRes_Binary(
1715+
N,
1716+
(VT == MVT::ppcf128 ? RTLIB::COPYSIGN_PPCF128 : RTLIB::UNKNOWN_LIBCALL),
1717+
Lo, Hi);
17181718
}
17191719

17201720
void DAGTypeLegalizer::ExpandFloatRes_FCOS(SDNode *N,

0 commit comments

Comments
 (0)