[llvm] [Mips] Fix wrong qNaN encoding when -mnan=legacy (PR #153777)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 21 02:51:53 PDT 2025
================
@@ -8773,8 +8778,7 @@ SDValue TargetLowering::expandFMINIMUM_FMAXIMUM(SDNode *N,
// Propagate any NaN of both operands
if (!N->getFlags().hasNoNaNs() &&
(!DAG.isKnownNeverNaN(RHS) || !DAG.isKnownNeverNaN(LHS))) {
- ConstantFP *FPNaN = ConstantFP::get(*DAG.getContext(),
- APFloat::getNaN(VT.getFltSemantics()));
+ ConstantFP *FPNaN = ConstantFP::get(*DAG.getContext(), TLI.getNaNValue(VT));
----------------
RKSimon wrote:
```
ConstantFP *FPNaN = ConstantFP::get(*DAG.getContext(), getNaNValue(VT));
```
https://github.com/llvm/llvm-project/pull/153777
More information about the llvm-commits
mailing list