[llvm] Intrinsic: introduce minimumnum and maximumnum for IR and SelectionDAG (PR #96649)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 24 12:22:56 PDT 2024
================
@@ -8531,6 +8531,70 @@ SDValue TargetLowering::expandFMINIMUM_FMAXIMUM(SDNode *N,
return MinMax;
}
+SDValue TargetLowering::expandFMINIMUMNUM_FMAXIMUMNUM(SDNode *Node,
+ SelectionDAG &DAG) const {
+ SDLoc dl(Node);
+ unsigned NewOp = Node->getOpcode() == ISD::FMINIMUMNUM ? ISD::FMINNUM_IEEE
+ : ISD::FMAXNUM_IEEE;
+ EVT VT = Node->getValueType(0);
+
+ if (VT.isScalableVector())
+ report_fatal_error(
+ "Expanding fminimumnum/fmaximumnum for scalable vectors is undefined.");
----------------
arsenm wrote:
It's not undefined. But I don't see how scalable vectors are relevant here. The code should work as-is, this just needs to use the same type for every operation
https://github.com/llvm/llvm-project/pull/96649
More information about the llvm-commits
mailing list