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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 04:02:00 PDT 2024


================
@@ -1075,6 +1099,11 @@ bool IEEEFloat::isSignificandAllOnesExceptLSB() const {
 }
 
 bool IEEEFloat::isSignificandAllZeros() const {
+  // For the E8M0 format, this is always true since there are no
+  // actual significand bits.
+  if (semantics == &semFloat8E8M0FN)
+    return true;
----------------
arsenm wrote:

Can you avoid adding special case early exits for these? We shouldn't be treating these exotic formats as a common case, and I would hope this would naturally fall out from the code below 

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


More information about the llvm-commits mailing list