[llvm] Intrinsic: introduce minimumnum and maximumnum for IR and SelectionDAG (PR #96649)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 29 06:17:38 PDT 2024
================
@@ -8599,23 +8600,33 @@ SDValue TargetLowering::expandFMINIMUMNUM_FMAXIMUMNUM(SDNode *Node,
SDValue MinMaxQuiet = DAG.getNode(ISD::FADD, DL, VT, MinMax, MinMax, Flags);
MinMax =
DAG.getSelectCC(DL, MinMax, MinMax, MinMaxQuiet, MinMax, ISD::SETUO);
- //}
}
// Fixup signed zero behavior.
if (Options.NoSignedZerosFPMath || Flags.hasNoSignedZeros() ||
DAG.isKnownNeverZeroFloat(LHS) || DAG.isKnownNeverZeroFloat(RHS)) {
return MinMax;
} else {
+ SDValue LRound = LHS;
+ SDValue RRound = RHS;
+ EVT RCCVT = CCVT;
+ // expandIS_FPCLASS is buggy for GPR32+FPR64. Let's round them to single for this case.
+ if (TT.isArch32Bit() && !isOperationLegalOrCustom(ISD::IS_FPCLASS, VT) && VT.getSizeInBits() > TT.getArchPointerBitWidth() && !TT.isX32()) {
+ LRound = DAG.getNode(ISD::FP_ROUND, DL, MVT::f32, LHS,
+ DAG.getIntPtrConstant(0, DL, /*isTarget=*/true));
+ RRound = DAG.getNode(ISD::FP_ROUND, DL, MVT::f32, RHS,
+ DAG.getIntPtrConstant(0, DL, /*isTarget=*/true));
+ RCCVT = getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(), MVT::f32);
+ }
----------------
arsenm wrote:
The actual condition would more be the integer bitcast of the FP type is not legal
https://github.com/llvm/llvm-project/pull/96649
More information about the llvm-commits
mailing list