[llvm] [Mips] Fix wrong qNaN encoding when -mnan=legacy (PR #153777)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 08:12:36 PDT 2025


================
@@ -1255,6 +1255,20 @@ static SDValue performSignExtendCombine(SDNode *N, SelectionDAG &DAG,
   return SDValue();
 }
 
+APFloat MipsTargetLowering::getNaNValue(EVT VT) const {
+  if (!Subtarget.isNaN2008()) {
+    if (&VT.getFltSemantics() == &APFloat::IEEEsingle()) {
----------------
arsenm wrote:

Avoid repeated getFltSemantics calls. Plus this should be rewritten generically to not depend on the exact format, but derived from the format properties 

https://github.com/llvm/llvm-project/pull/153777


More information about the llvm-commits mailing list