Skip to content

Commit 0606b62

Browse files
[SelectionDAG] Only handle arch-specific COPYSIGNs as libcalls
1 parent 769424a commit 0606b62

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp

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

16501650
void DAGTypeLegalizer::ExpandFloatRes_FCOPYSIGN(SDNode *N,
16511651
SDValue &Lo, SDValue &Hi) {
1652-
ExpandFloatRes_Binary(N, GetFPLibCall(N->getValueType(0),
1653-
RTLIB::COPYSIGN_F32,
1654-
RTLIB::COPYSIGN_F64,
1655-
RTLIB::COPYSIGN_F80,
1656-
RTLIB::COPYSIGN_F128,
1657-
RTLIB::COPYSIGN_PPCF128), Lo, Hi);
1652+
1653+
auto VT = N->getValueType(0);
1654+
ExpandFloatRes_Binary(N,
1655+
(VT == MVT::f80 ? RTLIB::COPYSIGN_F80
1656+
: VT == MVT::ppcf128 ? RTLIB::COPYSIGN_PPCF128
1657+
: RTLIB::UNKNOWN_LIBCALL),
1658+
Lo, Hi);
16581659
}
16591660

16601661
void DAGTypeLegalizer::ExpandFloatRes_FCOS(SDNode *N,

0 commit comments

Comments
 (0)