[PATCH] D75246: Fix reporting inexact status in IEEEFloat::roundToIntegral

Steve Canon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 10:46:58 PDT 2020


scanon added inline comments.


================
Comment at: llvm/lib/Support/APFloat.cpp:2011
+  opStatus IsInexact = static_cast<opStatus>(fs & opInexact);
+  if (fs != opOK && !IsInexact)
     return fs;
----------------
What is this check intended to do? AFAICT from a quick glance, this will never happen.


================
Comment at: llvm/lib/Support/APFloat.cpp:2020
 
-  return fs;
+  return fs == opOK ? IsInexact : fs;
 }
----------------
fs will never be anything other than opOK here, right? By Sterbenz' lemma this subtraction is always exact.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75246/new/

https://reviews.llvm.org/D75246





More information about the llvm-commits mailing list