Skip to content

Commit 8aa7406

Browse files
committed
[RISCV]: Map to FMINIMUMNUM
1 parent a7af5b2 commit 8aa7406

File tree

3 files changed

+3606
-126
lines changed

3 files changed

+3606
-126
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,14 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FABS(SDNode *N) {
314314
}
315315

316316
SDValue DAGTypeLegalizer::SoftenFloatRes_FCANONICALIZE(SDNode *N) {
317-
return SoftenFloatRes_Unary(
318-
N, GetFPLibCall(N->getValueType(0), RTLIB::FMIN_F32, RTLIB::FMIN_F64,
319-
RTLIB::FMIN_F80, RTLIB::FMIN_F128, RTLIB::FMIN_PPCF128));
317+
SDLoc dl(N);
318+
auto Node = DAG.getNode(ISD::FMINIMUMNUM, dl, N->getValueType(0),
319+
N->getOperand(0), N->getOperand(0));
320+
return SoftenFloatRes_Binary(
321+
Node.getNode(),
322+
GetFPLibCall(N->getValueType(0), RTLIB::FMINIMUM_NUM_F32,
323+
RTLIB::FMINIMUM_NUM_F64, RTLIB::FMINIMUM_NUM_F80,
324+
RTLIB::FMINIMUM_NUM_F128, RTLIB::FMINIMUM_NUM_PPCF128));
320325
}
321326

322327
SDValue DAGTypeLegalizer::SoftenFloatRes_FMINNUM(SDNode *N) {

llvm/test/CodeGen/RISCV/fcanonicalize.ll

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)