diff --git a/include/llvm/CodeGen/BasicTTIImpl.h b/include/llvm/CodeGen/BasicTTIImpl.h index 18c9a61d19b..3f7a1206c84 100644 --- a/include/llvm/CodeGen/BasicTTIImpl.h +++ b/include/llvm/CodeGen/BasicTTIImpl.h @@ -1073,12 +1073,12 @@ public: case Intrinsic::minnum: ISDs.push_back(ISD::FMINNUM); if (FMF.noNaNs()) - ISDs.push_back(ISD::FMINNAN); + ISDs.push_back(ISD::FMINIMUM); break; case Intrinsic::maxnum: ISDs.push_back(ISD::FMAXNUM); if (FMF.noNaNs()) - ISDs.push_back(ISD::FMAXNAN); + ISDs.push_back(ISD::FMAXIMUM); break; case Intrinsic::copysign: ISDs.push_back(ISD::FCOPYSIGN); diff --git a/include/llvm/CodeGen/ISDOpcodes.h b/include/llvm/CodeGen/ISDOpcodes.h index 75ec0b99a12..1c0318d6a70 100644 --- a/include/llvm/CodeGen/ISDOpcodes.h +++ b/include/llvm/CodeGen/ISDOpcodes.h @@ -577,10 +577,10 @@ namespace ISD { /// signaling NaN, returns a quiet NaN. FMINNUM_IEEE, FMAXNUM_IEEE, - /// FMINNAN/FMAXNAN - NaN-propagating minimum/maximum that also treat -0.0 - /// as less than 0.0. While FMINNUM/FMAXNUM follow IEEE 754-2008 semantics, - /// FMINNAN/FMAXNAN follow IEEE 754-2018 draft semantics. - FMINNAN, FMAXNAN, + /// FMINIMUM/FMAXIMUM - NaN-propagating minimum/maximum that also treat -0.0 + /// as less than 0.0. While FMINNUM_IEEE/FMAXNUM_IEEE follow IEEE 754-2008 + /// semantics, FMINIMUM/FMAXIMUM follow IEEE 754-2018 draft semantics. + FMINIMUM, FMAXIMUM, /// FSINCOS - Compute both fsin and fcos as a single operation. FSINCOS, diff --git a/include/llvm/CodeGen/TargetLowering.h b/include/llvm/CodeGen/TargetLowering.h index 4b1fae89be5..9fae319ac88 100644 --- a/include/llvm/CodeGen/TargetLowering.h +++ b/include/llvm/CodeGen/TargetLowering.h @@ -2099,8 +2099,8 @@ public: case ISD::ADDE: case ISD::FMINNUM: case ISD::FMAXNUM: - case ISD::FMINNAN: - case ISD::FMAXNAN: + case ISD::FMINIMUM: + case ISD::FMAXIMUM: return true; default: return false; } diff --git a/include/llvm/Target/TargetSelectionDAG.td b/include/llvm/Target/TargetSelectionDAG.td index c235c85e144..b1558b0f347 100644 --- a/include/llvm/Target/TargetSelectionDAG.td +++ b/include/llvm/Target/TargetSelectionDAG.td @@ -413,9 +413,8 @@ def fminnum_ieee : SDNode<"ISD::FMINNUM_IEEE", SDTFPBinOp, [SDNPCommutative]>; def fmaxnum_ieee : SDNode<"ISD::FMAXNUM_IEEE", SDTFPBinOp, [SDNPCommutative]>; - -def fminnan : SDNode<"ISD::FMINNAN" , SDTFPBinOp>; -def fmaxnan : SDNode<"ISD::FMAXNAN" , SDTFPBinOp>; +def fminimum : SDNode<"ISD::FMINIMUM" , SDTFPBinOp>; +def fmaximum : SDNode<"ISD::FMAXIMUM" , SDTFPBinOp>; def fgetsign : SDNode<"ISD::FGETSIGN" , SDTFPToIntOp>; def fcanonicalize : SDNode<"ISD::FCANONICALIZE", SDTFPUnaryOp>; def fneg : SDNode<"ISD::FNEG" , SDTFPUnaryOp>; diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 4f5e96a8257..e8584921c42 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -371,8 +371,8 @@ namespace { SDValue visitFFLOOR(SDNode *N); SDValue visitFMINNUM(SDNode *N); SDValue visitFMAXNUM(SDNode *N); - SDValue visitFMINNAN(SDNode *N); - SDValue visitFMAXNAN(SDNode *N); + SDValue visitFMINIMUM(SDNode *N); + SDValue visitFMAXIMUM(SDNode *N); SDValue visitBRCOND(SDNode *N); SDValue visitBR_CC(SDNode *N); SDValue visitLOAD(SDNode *N); @@ -1584,8 +1584,8 @@ SDValue DAGCombiner::visit(SDNode *N) { case ISD::FFLOOR: return visitFFLOOR(N); case ISD::FMINNUM: return visitFMINNUM(N); case ISD::FMAXNUM: return visitFMAXNUM(N); - case ISD::FMINNAN: return visitFMINNAN(N); - case ISD::FMAXNAN: return visitFMAXNAN(N); + case ISD::FMINIMUM: return visitFMINIMUM(N); + case ISD::FMAXIMUM: return visitFMAXIMUM(N); case ISD::FCEIL: return visitFCEIL(N); case ISD::FTRUNC: return visitFTRUNC(N); case ISD::BRCOND: return visitBRCOND(N); @@ -12158,11 +12158,11 @@ SDValue DAGCombiner::visitFMAXNUM(SDNode *N) { return visitFMinMax(DAG, N, maxnum); } -SDValue DAGCombiner::visitFMINNAN(SDNode *N) { +SDValue DAGCombiner::visitFMINIMUM(SDNode *N) { return visitFMinMax(DAG, N, minimum); } -SDValue DAGCombiner::visitFMAXNAN(SDNode *N) { +SDValue DAGCombiner::visitFMAXIMUM(SDNode *N) { return visitFMinMax(DAG, N, maximum); } diff --git a/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp index b6cce910228..866744c397b 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp @@ -1910,8 +1910,8 @@ void DAGTypeLegalizer::PromoteFloatResult(SDNode *N, unsigned ResNo) { // Binary FP Operations case ISD::FADD: case ISD::FDIV: - case ISD::FMAXNAN: - case ISD::FMINNAN: + case ISD::FMAXIMUM: + case ISD::FMINIMUM: case ISD::FMAXNUM: case ISD::FMINNUM: case ISD::FMUL: diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp index fdb74fef121..850cdcd1701 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp @@ -356,8 +356,8 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) { case ISD::FMAXNUM: case ISD::FMINNUM_IEEE: case ISD::FMAXNUM_IEEE: - case ISD::FMINNAN: - case ISD::FMAXNAN: + case ISD::FMINIMUM: + case ISD::FMAXIMUM: case ISD::FCOPYSIGN: case ISD::FSQRT: case ISD::FSIN: diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index 43b4bf0c497..58446101556 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -115,8 +115,8 @@ void DAGTypeLegalizer::ScalarizeVectorResult(SDNode *N, unsigned ResNo) { case ISD::FMAXNUM: case ISD::FMINNUM_IEEE: case ISD::FMAXNUM_IEEE: - case ISD::FMINNAN: - case ISD::FMAXNAN: + case ISD::FMINIMUM: + case ISD::FMAXIMUM: case ISD::SMIN: case ISD::SMAX: case ISD::UMIN: @@ -786,8 +786,8 @@ void DAGTypeLegalizer::SplitVectorResult(SDNode *N, unsigned ResNo) { case ISD::FMUL: case ISD::FMINNUM: case ISD::FMAXNUM: - case ISD::FMINNAN: - case ISD::FMAXNAN: + case ISD::FMINIMUM: + case ISD::FMAXIMUM: case ISD::SDIV: case ISD::UDIV: case ISD::FDIV: @@ -1804,10 +1804,10 @@ SDValue DAGTypeLegalizer::SplitVecOp_VECREDUCE(SDNode *N, unsigned OpNo) { case ISD::VECREDUCE_UMAX: CombineOpc = ISD::UMAX; break; case ISD::VECREDUCE_UMIN: CombineOpc = ISD::UMIN; break; case ISD::VECREDUCE_FMAX: - CombineOpc = NoNaN ? ISD::FMAXNUM : ISD::FMAXNAN; + CombineOpc = NoNaN ? ISD::FMAXNUM : ISD::FMAXIMUM; break; case ISD::VECREDUCE_FMIN: - CombineOpc = NoNaN ? ISD::FMINNUM : ISD::FMINNAN; + CombineOpc = NoNaN ? ISD::FMINNUM : ISD::FMINIMUM; break; default: llvm_unreachable("Unexpected reduce ISD node"); @@ -2356,8 +2356,8 @@ void DAGTypeLegalizer::WidenVectorResult(SDNode *N, unsigned ResNo) { case ISD::XOR: case ISD::FMINNUM: case ISD::FMAXNUM: - case ISD::FMINNAN: - case ISD::FMAXNAN: + case ISD::FMINIMUM: + case ISD::FMAXIMUM: case ISD::SMIN: case ISD::SMAX: case ISD::UMIN: diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 1f63923d7ec..2d99a6aecb5 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3730,12 +3730,11 @@ bool SelectionDAG::isKnownNeverNaN(SDValue Op, bool SNaN, unsigned Depth) const (isKnownNeverNaN(Op.getOperand(1), false, Depth + 1) && isKnownNeverSNaN(Op.getOperand(0), Depth + 1)); } - case ISD::FMINNAN: - case ISD::FMAXNAN: { + case ISD::FMINIMUM: + case ISD::FMAXIMUM: { // TODO: Does this quiet or return the origina NaN as-is? return isKnownNeverNaN(Op.getOperand(0), SNaN, Depth + 1) && isKnownNeverNaN(Op.getOperand(1), SNaN, Depth + 1); - } case ISD::EXTRACT_VECTOR_ELT: { return isKnownNeverNaN(Op.getOperand(0), SNaN, Depth + 1); diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 87921ccb074..05eac30843f 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -2972,16 +2972,16 @@ void SelectionDAGBuilder::visitSelect(const User &I) { case SPF_FMINNUM: switch (SPR.NaNBehavior) { case SPNB_NA: llvm_unreachable("No NaN behavior for FP op?"); - case SPNB_RETURNS_NAN: Opc = ISD::FMINNAN; break; + case SPNB_RETURNS_NAN: Opc = ISD::FMINIMUM; break; case SPNB_RETURNS_OTHER: Opc = ISD::FMINNUM; break; case SPNB_RETURNS_ANY: { if (TLI.isOperationLegalOrCustom(ISD::FMINNUM, VT)) Opc = ISD::FMINNUM; - else if (TLI.isOperationLegalOrCustom(ISD::FMINNAN, VT)) - Opc = ISD::FMINNAN; + else if (TLI.isOperationLegalOrCustom(ISD::FMINIMUM, VT)) + Opc = ISD::FMINIMUM; else if (UseScalarMinMax) Opc = TLI.isOperationLegalOrCustom(ISD::FMINNUM, VT.getScalarType()) ? - ISD::FMINNUM : ISD::FMINNAN; + ISD::FMINNUM : ISD::FMINIMUM; break; } } @@ -2989,17 +2989,17 @@ void SelectionDAGBuilder::visitSelect(const User &I) { case SPF_FMAXNUM: switch (SPR.NaNBehavior) { case SPNB_NA: llvm_unreachable("No NaN behavior for FP op?"); - case SPNB_RETURNS_NAN: Opc = ISD::FMAXNAN; break; + case SPNB_RETURNS_NAN: Opc = ISD::FMAXIMUM; break; case SPNB_RETURNS_OTHER: Opc = ISD::FMAXNUM; break; case SPNB_RETURNS_ANY: if (TLI.isOperationLegalOrCustom(ISD::FMAXNUM, VT)) Opc = ISD::FMAXNUM; - else if (TLI.isOperationLegalOrCustom(ISD::FMAXNAN, VT)) - Opc = ISD::FMAXNAN; + else if (TLI.isOperationLegalOrCustom(ISD::FMAXIMUM, VT)) + Opc = ISD::FMAXIMUM; else if (UseScalarMinMax) Opc = TLI.isOperationLegalOrCustom(ISD::FMAXNUM, VT.getScalarType()) ? - ISD::FMAXNUM : ISD::FMAXNAN; + ISD::FMAXNUM : ISD::FMAXIMUM; break; } break; @@ -5565,8 +5565,8 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) { case Intrinsic::minnum: { auto VT = getValue(I.getArgOperand(0)).getValueType(); unsigned Opc = - I.hasNoNaNs() && TLI.isOperationLegalOrCustom(ISD::FMINNAN, VT) - ? ISD::FMINNAN + I.hasNoNaNs() && TLI.isOperationLegalOrCustom(ISD::FMINIMUM, VT) + ? ISD::FMINIMUM : ISD::FMINNUM; setValue(&I, DAG.getNode(Opc, sdl, VT, getValue(I.getArgOperand(0)), @@ -5576,8 +5576,8 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) { case Intrinsic::maxnum: { auto VT = getValue(I.getArgOperand(0)).getValueType(); unsigned Opc = - I.hasNoNaNs() && TLI.isOperationLegalOrCustom(ISD::FMAXNAN, VT) - ? ISD::FMAXNAN + I.hasNoNaNs() && TLI.isOperationLegalOrCustom(ISD::FMAXIMUM, VT) + ? ISD::FMAXIMUM : ISD::FMAXNUM; setValue(&I, DAG.getNode(Opc, sdl, VT, getValue(I.getArgOperand(0)), @@ -5585,13 +5585,13 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) { return nullptr; } case Intrinsic::minimum: - setValue(&I, DAG.getNode(ISD::FMINNAN, sdl, + setValue(&I, DAG.getNode(ISD::FMINIMUM, sdl, getValue(I.getArgOperand(0)).getValueType(), getValue(I.getArgOperand(0)), getValue(I.getArgOperand(1)))); return nullptr; case Intrinsic::maximum: - setValue(&I, DAG.getNode(ISD::FMAXNAN, sdl, + setValue(&I, DAG.getNode(ISD::FMAXIMUM, sdl, getValue(I.getArgOperand(0)).getValueType(), getValue(I.getArgOperand(0)), getValue(I.getArgOperand(1)))); diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp index 1b032ce456a..1c9a49306c6 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp @@ -178,9 +178,8 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const { case ISD::FMAXNUM: return "fmaxnum"; case ISD::FMINNUM_IEEE: return "fminnum_ieee"; case ISD::FMAXNUM_IEEE: return "fmaxnum_ieee"; - - case ISD::FMINNAN: return "fminnan"; - case ISD::FMAXNAN: return "fmaxnan"; + case ISD::FMINIMUM: return "fminimum"; + case ISD::FMAXIMUM: return "fmaximum"; case ISD::FNEG: return "fneg"; case ISD::FSQRT: return "fsqrt"; case ISD::STRICT_FSQRT: return "strict_fsqrt"; diff --git a/lib/CodeGen/TargetLoweringBase.cpp b/lib/CodeGen/TargetLoweringBase.cpp index 09c5b527956..715112edc17 100644 --- a/lib/CodeGen/TargetLoweringBase.cpp +++ b/lib/CodeGen/TargetLoweringBase.cpp @@ -602,8 +602,8 @@ void TargetLoweringBase::initActions() { setOperationAction(ISD::FMAXNUM, VT, Expand); setOperationAction(ISD::FMINNUM_IEEE, VT, Expand); setOperationAction(ISD::FMAXNUM_IEEE, VT, Expand); - setOperationAction(ISD::FMINNAN, VT, Expand); - setOperationAction(ISD::FMAXNAN, VT, Expand); + setOperationAction(ISD::FMINIMUM, VT, Expand); + setOperationAction(ISD::FMAXIMUM, VT, Expand); setOperationAction(ISD::FMAD, VT, Expand); setOperationAction(ISD::SMIN, VT, Expand); setOperationAction(ISD::SMAX, VT, Expand); diff --git a/lib/Target/AArch64/AArch64ISelLowering.cpp b/lib/Target/AArch64/AArch64ISelLowering.cpp index c8227cd139a..a7a1b0a5feb 100644 --- a/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -385,8 +385,8 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM, setOperationAction(ISD::FTRUNC, MVT::f16, Promote); setOperationAction(ISD::FMINNUM, MVT::f16, Promote); setOperationAction(ISD::FMAXNUM, MVT::f16, Promote); - setOperationAction(ISD::FMINNAN, MVT::f16, Promote); - setOperationAction(ISD::FMAXNAN, MVT::f16, Promote); + setOperationAction(ISD::FMINIMUM, MVT::f16, Promote); + setOperationAction(ISD::FMAXIMUM, MVT::f16, Promote); // promote v4f16 to v4f32 when that is known to be safe. setOperationAction(ISD::FADD, MVT::v4f16, Promote); @@ -450,8 +450,8 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM, setOperationAction(ISD::FROUND, Ty, Legal); setOperationAction(ISD::FMINNUM, Ty, Legal); setOperationAction(ISD::FMAXNUM, Ty, Legal); - setOperationAction(ISD::FMINNAN, Ty, Legal); - setOperationAction(ISD::FMAXNAN, Ty, Legal); + setOperationAction(ISD::FMINIMUM, Ty, Legal); + setOperationAction(ISD::FMAXIMUM, Ty, Legal); } if (Subtarget->hasFullFP16()) { @@ -463,8 +463,8 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM, setOperationAction(ISD::FROUND, MVT::f16, Legal); setOperationAction(ISD::FMINNUM, MVT::f16, Legal); setOperationAction(ISD::FMAXNUM, MVT::f16, Legal); - setOperationAction(ISD::FMINNAN, MVT::f16, Legal); - setOperationAction(ISD::FMAXNAN, MVT::f16, Legal); + setOperationAction(ISD::FMINIMUM, MVT::f16, Legal); + setOperationAction(ISD::FMAXIMUM, MVT::f16, Legal); } setOperationAction(ISD::PREFETCH, MVT::Other, Custom); @@ -816,8 +816,8 @@ void AArch64TargetLowering::addTypeForNEON(MVT VT, MVT PromotedBitwiseVT) { // F[MIN|MAX][NUM|NAN] are available for all FP NEON types. if (VT.isFloatingPoint() && (VT.getVectorElementType() != MVT::f16 || Subtarget->hasFullFP16())) - for (unsigned Opcode : {ISD::FMINNAN, ISD::FMAXNAN, - ISD::FMINNUM, ISD::FMAXNUM}) + for (unsigned Opcode : + {ISD::FMINIMUM, ISD::FMAXIMUM, ISD::FMINNUM, ISD::FMAXNUM}) setOperationAction(Opcode, VT, Legal); if (Subtarget->isLittleEndian()) { @@ -9867,10 +9867,10 @@ static SDValue performIntrinsicCombine(SDNode *N, case Intrinsic::aarch64_neon_umaxv: return combineAcrossLanesIntrinsic(AArch64ISD::UMAXV, N, DAG); case Intrinsic::aarch64_neon_fmax: - return DAG.getNode(ISD::FMAXNAN, SDLoc(N), N->getValueType(0), + return DAG.getNode(ISD::FMAXIMUM, SDLoc(N), N->getValueType(0), N->getOperand(1), N->getOperand(2)); case Intrinsic::aarch64_neon_fmin: - return DAG.getNode(ISD::FMINNAN, SDLoc(N), N->getValueType(0), + return DAG.getNode(ISD::FMINIMUM, SDLoc(N), N->getValueType(0), N->getOperand(1), N->getOperand(2)); case Intrinsic::aarch64_neon_fmaxnm: return DAG.getNode(ISD::FMAXNUM, SDLoc(N), N->getValueType(0), diff --git a/lib/Target/AArch64/AArch64InstrInfo.td b/lib/Target/AArch64/AArch64InstrInfo.td index 24f6aaaab57..88e5632fbe6 100644 --- a/lib/Target/AArch64/AArch64InstrInfo.td +++ b/lib/Target/AArch64/AArch64InstrInfo.td @@ -3050,18 +3050,18 @@ let SchedRW = [WriteFDiv] in { defm FDIV : TwoOperandFPData<0b0001, "fdiv", fdiv>; } defm FMAXNM : TwoOperandFPData<0b0110, "fmaxnm", fmaxnum>; -defm FMAX : TwoOperandFPData<0b0100, "fmax", fmaxnan>; +defm FMAX : TwoOperandFPData<0b0100, "fmax", fmaximum>; defm FMINNM : TwoOperandFPData<0b0111, "fminnm", fminnum>; -defm FMIN : TwoOperandFPData<0b0101, "fmin", fminnan>; +defm FMIN : TwoOperandFPData<0b0101, "fmin", fminimum>; let SchedRW = [WriteFMul] in { defm FMUL : TwoOperandFPData<0b0000, "fmul", fmul>; defm FNMUL : TwoOperandFPDataNeg<0b1000, "fnmul", fmul>; } defm FSUB : TwoOperandFPData<0b0011, "fsub", fsub>; -def : Pat<(v1f64 (fmaxnan (v1f64 FPR64:$Rn), (v1f64 FPR64:$Rm))), +def : Pat<(v1f64 (fmaximum (v1f64 FPR64:$Rn), (v1f64 FPR64:$Rm))), (FMAXDrr FPR64:$Rn, FPR64:$Rm)>; -def : Pat<(v1f64 (fminnan (v1f64 FPR64:$Rn), (v1f64 FPR64:$Rm))), +def : Pat<(v1f64 (fminimum (v1f64 FPR64:$Rn), (v1f64 FPR64:$Rm))), (FMINDrr FPR64:$Rn, FPR64:$Rm)>; def : Pat<(v1f64 (fmaxnum (v1f64 FPR64:$Rn), (v1f64 FPR64:$Rm))), (FMAXNMDrr FPR64:$Rn, FPR64:$Rm)>; @@ -3387,11 +3387,11 @@ defm FDIV : SIMDThreeSameVectorFP<1,0,0b111,"fdiv", fdiv>; defm FMAXNMP : SIMDThreeSameVectorFP<1,0,0b000,"fmaxnmp", int_aarch64_neon_fmaxnmp>; defm FMAXNM : SIMDThreeSameVectorFP<0,0,0b000,"fmaxnm", fmaxnum>; defm FMAXP : SIMDThreeSameVectorFP<1,0,0b110,"fmaxp", int_aarch64_neon_fmaxp>; -defm FMAX : SIMDThreeSameVectorFP<0,0,0b110,"fmax", fmaxnan>; +defm FMAX : SIMDThreeSameVectorFP<0,0,0b110,"fmax", fmaximum>; defm FMINNMP : SIMDThreeSameVectorFP<1,1,0b000,"fminnmp", int_aarch64_neon_fminnmp>; defm FMINNM : SIMDThreeSameVectorFP<0,1,0b000,"fminnm", fminnum>; defm FMINP : SIMDThreeSameVectorFP<1,1,0b110,"fminp", int_aarch64_neon_fminp>; -defm FMIN : SIMDThreeSameVectorFP<0,1,0b110,"fmin", fminnan>; +defm FMIN : SIMDThreeSameVectorFP<0,1,0b110,"fmin", fminimum>; // NOTE: The operands of the PatFrag are reordered on FMLA/FMLS because the // instruction expects the addend first, while the fma intrinsic puts it last. diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index 8c18477005f..0f68fb0287c 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -1143,14 +1143,14 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM, if (Subtarget->hasNEON()) { // vmin and vmax aren't available in a scalar form, so we use // a NEON instruction with an undef lane instead. - setOperationAction(ISD::FMINNAN, MVT::f16, Legal); - setOperationAction(ISD::FMAXNAN, MVT::f16, Legal); - setOperationAction(ISD::FMINNAN, MVT::f32, Legal); - setOperationAction(ISD::FMAXNAN, MVT::f32, Legal); - setOperationAction(ISD::FMINNAN, MVT::v2f32, Legal); - setOperationAction(ISD::FMAXNAN, MVT::v2f32, Legal); - setOperationAction(ISD::FMINNAN, MVT::v4f32, Legal); - setOperationAction(ISD::FMAXNAN, MVT::v4f32, Legal); + setOperationAction(ISD::FMINIMUM, MVT::f16, Legal); + setOperationAction(ISD::FMAXIMUM, MVT::f16, Legal); + setOperationAction(ISD::FMINIMUM, MVT::f32, Legal); + setOperationAction(ISD::FMAXIMUM, MVT::f32, Legal); + setOperationAction(ISD::FMINIMUM, MVT::v2f32, Legal); + setOperationAction(ISD::FMAXIMUM, MVT::v2f32, Legal); + setOperationAction(ISD::FMINIMUM, MVT::v4f32, Legal); + setOperationAction(ISD::FMAXIMUM, MVT::v4f32, Legal); if (Subtarget->hasFullFP16()) { setOperationAction(ISD::FMINNUM, MVT::v4f16, Legal); @@ -1158,10 +1158,10 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM, setOperationAction(ISD::FMINNUM, MVT::v8f16, Legal); setOperationAction(ISD::FMAXNUM, MVT::v8f16, Legal); - setOperationAction(ISD::FMINNAN, MVT::v4f16, Legal); - setOperationAction(ISD::FMAXNAN, MVT::v4f16, Legal); - setOperationAction(ISD::FMINNAN, MVT::v8f16, Legal); - setOperationAction(ISD::FMAXNAN, MVT::v8f16, Legal); + setOperationAction(ISD::FMINIMUM, MVT::v4f16, Legal); + setOperationAction(ISD::FMAXIMUM, MVT::v4f16, Legal); + setOperationAction(ISD::FMINIMUM, MVT::v8f16, Legal); + setOperationAction(ISD::FMAXIMUM, MVT::v8f16, Legal); } } @@ -3408,7 +3408,7 @@ ARMTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG, Op.getOperand(1), Op.getOperand(2)); } unsigned NewOpc = (IntNo == Intrinsic::arm_neon_vmins) - ? ISD::FMINNAN : ISD::FMAXNAN; + ? ISD::FMINIMUM : ISD::FMAXIMUM; return DAG.getNode(NewOpc, SDLoc(Op), Op.getValueType(), Op.getOperand(1), Op.getOperand(2)); } diff --git a/lib/Target/ARM/ARMInstrNEON.td b/lib/Target/ARM/ARMInstrNEON.td index 2085507056b..96986e74415 100644 --- a/lib/Target/ARM/ARMInstrNEON.td +++ b/lib/Target/ARM/ARMInstrNEON.td @@ -5521,17 +5521,17 @@ defm VMAXu : N3VInt_QHS<1, 0, 0b0110, 0, N3RegFrm, "vmax", "u", umax, 1>; def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBIND, "vmax", "f32", - v2f32, v2f32, fmaxnan, 1>; + v2f32, v2f32, fmaximum, 1>; def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBINQ, "vmax", "f32", - v4f32, v4f32, fmaxnan, 1>; + v4f32, v4f32, fmaximum, 1>; def VMAXhd : N3VDInt<0, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VBIND, "vmax", "f16", - v4f16, v4f16, fmaxnan, 1>, + v4f16, v4f16, fmaximum, 1>, Requires<[HasNEON, HasFullFP16]>; def VMAXhq : N3VQInt<0, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VBINQ, "vmax", "f16", - v8f16, v8f16, fmaxnan, 1>, + v8f16, v8f16, fmaximum, 1>, Requires<[HasNEON, HasFullFP16]>; // VMAXNM @@ -5563,17 +5563,17 @@ defm VMINu : N3VInt_QHS<1, 0, 0b0110, 1, N3RegFrm, "vmin", "u", umin, 1>; def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBIND, "vmin", "f32", - v2f32, v2f32, fminnan, 1>; + v2f32, v2f32, fminimum, 1>; def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBINQ, "vmin", "f32", - v4f32, v4f32, fminnan, 1>; + v4f32, v4f32, fminimum, 1>; def VMINhd : N3VDInt<0, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VBIND, "vmin", "f16", - v4f16, v4f16, fminnan, 1>, + v4f16, v4f16, fminimum, 1>, Requires<[HasNEON, HasFullFP16]>; def VMINhq : N3VQInt<0, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VBINQ, "vmin", "f16", - v8f16, v8f16, fminnan, 1>, + v8f16, v8f16, fminimum, 1>, Requires<[HasNEON, HasFullFP16]>; // VMINNM @@ -7093,10 +7093,10 @@ def : N3VSMulOpPat, Requires<[HasVFP4, UseNEONForFP, UseFusedMAC]>; def : N2VSPat; def : N2VSPat; -def : N3VSPatFP16, Requires<[HasFullFP16]>; -def : N3VSPatFP16, Requires<[HasFullFP16]>; -def : N3VSPat, Requires<[HasNEON]>; -def : N3VSPat, Requires<[HasNEON]>; +def : N3VSPatFP16, Requires<[HasFullFP16]>; +def : N3VSPatFP16, Requires<[HasFullFP16]>; +def : N3VSPat, Requires<[HasNEON]>; +def : N3VSPat, Requires<[HasNEON]>; def : NVCVTFIPat; def : NVCVTFIPat; def : NVCVTIFPat; diff --git a/lib/Target/Mips/MipsSEISelLowering.cpp b/lib/Target/Mips/MipsSEISelLowering.cpp index f625a2903bd..d745ce00149 100644 --- a/lib/Target/Mips/MipsSEISelLowering.cpp +++ b/lib/Target/Mips/MipsSEISelLowering.cpp @@ -158,8 +158,8 @@ MipsSETargetLowering::MipsSETargetLowering(const MipsTargetMachine &TM, setOperationAction(ISD::FTRUNC, MVT::f16, Promote); setOperationAction(ISD::FMINNUM, MVT::f16, Promote); setOperationAction(ISD::FMAXNUM, MVT::f16, Promote); - setOperationAction(ISD::FMINNAN, MVT::f16, Promote); - setOperationAction(ISD::FMAXNAN, MVT::f16, Promote); + setOperationAction(ISD::FMINIMUM, MVT::f16, Promote); + setOperationAction(ISD::FMAXIMUM, MVT::f16, Promote); setTargetDAGCombine(ISD::AND); setTargetDAGCombine(ISD::OR); diff --git a/lib/Target/NVPTX/NVPTXISelLowering.cpp b/lib/Target/NVPTX/NVPTXISelLowering.cpp index 2536623fb85..1f323b63034 100644 --- a/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -560,8 +560,8 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM, } setOperationAction(ISD::FMINNUM, MVT::f16, Promote); setOperationAction(ISD::FMAXNUM, MVT::f16, Promote); - setOperationAction(ISD::FMINNAN, MVT::f16, Promote); - setOperationAction(ISD::FMAXNAN, MVT::f16, Promote); + setOperationAction(ISD::FMINIMUM, MVT::f16, Promote); + setOperationAction(ISD::FMAXIMUM, MVT::f16, Promote); // No FEXP2, FLOG2. The PTX ex2 and log2 functions are always approximate. // No FPOW or FREM in PTX. diff --git a/lib/Target/SystemZ/SystemZISelLowering.cpp b/lib/Target/SystemZ/SystemZISelLowering.cpp index 7ab4024d43c..53cd21c4236 100644 --- a/lib/Target/SystemZ/SystemZISelLowering.cpp +++ b/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -452,29 +452,29 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM, setOperationAction(ISD::FROUND, MVT::v4f32, Legal); setOperationAction(ISD::FMAXNUM, MVT::f64, Legal); - setOperationAction(ISD::FMAXNAN, MVT::f64, Legal); + setOperationAction(ISD::FMAXIMUM, MVT::f64, Legal); setOperationAction(ISD::FMINNUM, MVT::f64, Legal); - setOperationAction(ISD::FMINNAN, MVT::f64, Legal); + setOperationAction(ISD::FMINIMUM, MVT::f64, Legal); setOperationAction(ISD::FMAXNUM, MVT::v2f64, Legal); - setOperationAction(ISD::FMAXNAN, MVT::v2f64, Legal); + setOperationAction(ISD::FMAXIMUM, MVT::v2f64, Legal); setOperationAction(ISD::FMINNUM, MVT::v2f64, Legal); - setOperationAction(ISD::FMINNAN, MVT::v2f64, Legal); + setOperationAction(ISD::FMINIMUM, MVT::v2f64, Legal); setOperationAction(ISD::FMAXNUM, MVT::f32, Legal); - setOperationAction(ISD::FMAXNAN, MVT::f32, Legal); + setOperationAction(ISD::FMAXIMUM, MVT::f32, Legal); setOperationAction(ISD::FMINNUM, MVT::f32, Legal); - setOperationAction(ISD::FMINNAN, MVT::f32, Legal); + setOperationAction(ISD::FMINIMUM, MVT::f32, Legal); setOperationAction(ISD::FMAXNUM, MVT::v4f32, Legal); - setOperationAction(ISD::FMAXNAN, MVT::v4f32, Legal); + setOperationAction(ISD::FMAXIMUM, MVT::v4f32, Legal); setOperationAction(ISD::FMINNUM, MVT::v4f32, Legal); - setOperationAction(ISD::FMINNAN, MVT::v4f32, Legal); + setOperationAction(ISD::FMINIMUM, MVT::v4f32, Legal); setOperationAction(ISD::FMAXNUM, MVT::f128, Legal); - setOperationAction(ISD::FMAXNAN, MVT::f128, Legal); + setOperationAction(ISD::FMAXIMUM, MVT::f128, Legal); setOperationAction(ISD::FMINNUM, MVT::f128, Legal); - setOperationAction(ISD::FMINNAN, MVT::f128, Legal); + setOperationAction(ISD::FMINIMUM, MVT::f128, Legal); } // We have fused multiply-addition for f32 and f64 but not f128. diff --git a/lib/Target/SystemZ/SystemZInstrVector.td b/lib/Target/SystemZ/SystemZInstrVector.td index 094d3a7de3d..8523af7e573 100644 --- a/lib/Target/SystemZ/SystemZInstrVector.td +++ b/lib/Target/SystemZ/SystemZInstrVector.td @@ -1031,7 +1031,7 @@ let Predicates = [FeatureVector] in { // Maximum. multiclass VectorMax { def : FPMinMax; - def : FPMinMax; + def : FPMinMax; } let Predicates = [FeatureVectorEnhancements1] in { def VFMAX : TernaryVRRcFloatGeneric<"vfmax", 0xE7EF>; @@ -1055,7 +1055,7 @@ let Predicates = [FeatureVector] in { // Minimum. multiclass VectorMin { def : FPMinMax; - def : FPMinMax; + def : FPMinMax; } let Predicates = [FeatureVectorEnhancements1] in { def VFMIN : TernaryVRRcFloatGeneric<"vfmin", 0xE7EE>; diff --git a/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index 1da66af5560..4b20404cf61 100644 --- a/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -105,9 +105,9 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering( for (auto Op : {ISD::FCEIL, ISD::FFLOOR, ISD::FTRUNC, ISD::FNEARBYINT, ISD::FRINT}) setOperationAction(Op, T, Legal); - // Support minnan and maxnan, which otherwise default to expand. - setOperationAction(ISD::FMINNAN, T, Legal); - setOperationAction(ISD::FMAXNAN, T, Legal); + // Support minimum and maximum, which otherwise default to expand. + setOperationAction(ISD::FMINIMUM, T, Legal); + setOperationAction(ISD::FMAXIMUM, T, Legal); // WebAssembly currently has no builtin f16 support. setOperationAction(ISD::FP16_TO_FP, T, Expand); setOperationAction(ISD::FP_TO_FP16, T, Expand); diff --git a/lib/Target/WebAssembly/WebAssemblyInstrFloat.td b/lib/Target/WebAssembly/WebAssemblyInstrFloat.td index 364c485f409..3c02b0f01ea 100644 --- a/lib/Target/WebAssembly/WebAssemblyInstrFloat.td +++ b/lib/Target/WebAssembly/WebAssemblyInstrFloat.td @@ -58,8 +58,8 @@ defm NEG : UnaryFP; defm COPYSIGN : BinaryFP; let isCommutable = 1 in { -defm MIN : BinaryFP; -defm MAX : BinaryFP; +defm MIN : BinaryFP; +defm MAX : BinaryFP; } // isCommutable = 1 defm CEIL : UnaryFP; diff --git a/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td b/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td index 711d42a219e..08bb39748b8 100644 --- a/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td +++ b/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td @@ -757,10 +757,10 @@ multiclass SIMDBinaryFP baseInst> { } // NaN-propagating minimum: min -defm MIN : SIMDBinaryFP; +defm MIN : SIMDBinaryFP; // NaN-propagating maximum: max -defm MAX : SIMDBinaryFP; +defm MAX : SIMDBinaryFP; //===----------------------------------------------------------------------===// // Floating-point arithmetic diff --git a/test/CodeGen/ARM/fp16-promote.ll b/test/CodeGen/ARM/fp16-promote.ll index dae9ef2ea83..d7eaddc9e40 100644 --- a/test/CodeGen/ARM/fp16-promote.ll +++ b/test/CodeGen/ARM/fp16-promote.ll @@ -644,7 +644,7 @@ define void @test_maxnum(half* %p, half* %q) #0 { ret void } -; CHECK-ALL-LABEL: test_minnan: +; CHECK-ALL-LABEL: test_minimum: ; CHECK-FP16: vmov.f32 s0, #1.000000e+00 ; CHECK-FP16: vcvtb.f32.f16 ; CHECK-LIBCALL: bl __aeabi_h2f @@ -654,7 +654,7 @@ define void @test_maxnum(half* %p, half* %q) #0 { ; CHECK-NOVFP: bl __aeabi_fcmpge ; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL: bl __aeabi_f2h -define void @test_minnan(half* %p) #0 { +define void @test_minimum(half* %p) #0 { %a = load half, half* %p, align 2 %c = fcmp ult half %a, 1.0 %r = select i1 %c, half %a, half 1.0 @@ -662,7 +662,7 @@ define void @test_minnan(half* %p) #0 { ret void } -; CHECK-ALL-LABEL: test_maxnan: +; CHECK-ALL-LABEL: test_maximum: ; CHECK-FP16: vmov.f32 s0, #1.000000e+00 ; CHECK-FP16: vcvtb.f32.f16 ; CHECK-LIBCALL: bl __aeabi_h2f @@ -672,7 +672,7 @@ define void @test_minnan(half* %p) #0 { ; CHECK-NOVFP: bl __aeabi_fcmple ; CHECK-FP16: vcvtb.f16.f32 ; CHECK-LIBCALL: bl __aeabi_f2h -define void @test_maxnan(half* %p) #0 { +define void @test_maximum(half* %p) #0 { %a = load half, half* %p, align 2 %c = fcmp ugt half %a, 1.0 %r = select i1 %c, half %a, half 1.0 diff --git a/test/CodeGen/SystemZ/vec-max-05.ll b/test/CodeGen/SystemZ/vec-max-05.ll index 591d3bf36f1..1fe0db350b7 100644 --- a/test/CodeGen/SystemZ/vec-max-05.ll +++ b/test/CodeGen/SystemZ/vec-max-05.ll @@ -42,7 +42,7 @@ define double @f3(double %dummy, double %val) { ret double %ret } -; Test a f64 constant compare/select resulting in maxnan. +; Test a f64 constant compare/select resulting in maximum. define double @f4(double %dummy, double %val) { ; CHECK-LABEL: f4: ; CHECK: lzdr [[REG:%f[0-9]+]] @@ -92,7 +92,7 @@ define float @f13(float %dummy, float %val) { ret float %ret } -; Test a f32 constant compare/select resulting in maxnan. +; Test a f32 constant compare/select resulting in maximum. define float @f14(float %dummy, float %val) { ; CHECK-LABEL: f14: ; CHECK: lzer [[REG:%f[0-9]+]] @@ -158,7 +158,7 @@ define void @f23(fp128 *%ptr, fp128 *%dst) { ret void } -; Test a f128 constant compare/select resulting in maxnan. +; Test a f128 constant compare/select resulting in maximum. define void @f24(fp128 *%ptr, fp128 *%dst) { ; CHECK-LABEL: f24: ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2) diff --git a/test/CodeGen/SystemZ/vec-min-05.ll b/test/CodeGen/SystemZ/vec-min-05.ll index 3eef9016cd0..6417e5ed750 100644 --- a/test/CodeGen/SystemZ/vec-min-05.ll +++ b/test/CodeGen/SystemZ/vec-min-05.ll @@ -42,7 +42,7 @@ define double @f3(double %dummy, double %val) { ret double %ret } -; Test a f64 constant compare/select resulting in minnan. +; Test a f64 constant compare/select resulting in minimum. define double @f4(double %dummy, double %val) { ; CHECK-LABEL: f4: ; CHECK: lzdr [[REG:%f[0-9]+]] @@ -92,7 +92,7 @@ define float @f13(float %dummy, float %val) { ret float %ret } -; Test a f32 constant compare/select resulting in minnan. +; Test a f32 constant compare/select resulting in minimum. define float @f14(float %dummy, float %val) { ; CHECK-LABEL: f14: ; CHECK: lzer [[REG:%f[0-9]+]] @@ -158,7 +158,7 @@ define void @f23(fp128 *%ptr, fp128 *%dst) { ret void } -; Test a f128 constant compare/select resulting in minnan. +; Test a f128 constant compare/select resulting in minimum. define void @f24(fp128 *%ptr, fp128 *%dst) { ; CHECK-LABEL: f24: ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2) diff --git a/unittests/Analysis/ValueTrackingTest.cpp b/unittests/Analysis/ValueTrackingTest.cpp index f391ca12e55..d6365176d08 100644 --- a/unittests/Analysis/ValueTrackingTest.cpp +++ b/unittests/Analysis/ValueTrackingTest.cpp @@ -149,7 +149,7 @@ TEST_F(MatchSelectPatternTest, FMinConstantZeroNsz) { expectPattern({SPF_FMINNUM, SPNB_RETURNS_OTHER, true}); } -TEST_F(MatchSelectPatternTest, VectorFMinNaN) { +TEST_F(MatchSelectPatternTest, VectorFMinimum) { parseAssembly( "define <4 x float> @test(<4 x float> %a) {\n" " %1 = fcmp ule <4 x float> %a, \n" @@ -177,7 +177,7 @@ TEST_F(MatchSelectPatternTest, VectorFMinOtherOrdered) { expectPattern({SPF_FMINNUM, SPNB_RETURNS_OTHER, true}); } -TEST_F(MatchSelectPatternTest, VectorNotFMinNaN) { +TEST_F(MatchSelectPatternTest, VectorNotFMinimum) { parseAssembly( "define <4 x float> @test(<4 x float> %a) {\n" " %1 = fcmp ule <4 x float> %a, \n"