[PATCH] D69776: [APFloat] Fix FP remainder operation

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 16:33:00 PST 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Support/APFloat.cpp:1818
+  fs = remainderSpecials(rhs);
+  if (fs != opDivByZero)
     return fs;
----------------
The opDivByZero thing is sort of confusing.  Maybe just something like `if (!isFinite() || !rhs.isFinite()) return remainderSpecials(rhs);`?


================
Comment at: llvm/lib/Support/APFloat.cpp:1899
+    if (result == cmpGreaterThan || result == cmpEqual)
+      fs = subtract(P, rmNearestTiesToEven);
+  }
----------------
Are all the subtractions here guaranteed to produce exact results?  If they are, would it make sense to assert that?


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

https://reviews.llvm.org/D69776





More information about the llvm-commits mailing list