[llvm] [APFloat] Add APFloat support for E8M0 type (PR #107127)

Durgadoss R via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 04:49:57 PDT 2024


================
@@ -4574,7 +4671,11 @@ IEEEFloat::opStatus IEEEFloat::next(bool nextDown) {
       // the integral bit to 1, and increment the exponent. If we have a
       // denormal always increment since moving denormals and the numbers in the
       // smallest normal binade have the same exponent in our representation.
-      bool WillCrossBinadeBoundary = !isDenormal() && isSignificandAllOnes();
+      // If there are only exponents, any increment always crosses the
+      // BinadeBoundary.
+      bool WillCrossBinadeBoundary =
+          !isDenormal() &&
+          (APFloat::hasSignificand(*semantics) ? isSignificandAllOnes() : true);
----------------
durga4github wrote:

Sure, simplified this in the latest revision.

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


More information about the llvm-commits mailing list