[clang] [llvm] [APFloat] Add APFloat support for FP6 data types (PR #94735)

Durgadoss R via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 7 12:23:58 PDT 2024


================
@@ -68,6 +68,10 @@ enum class fltNonfiniteBehavior {
   // `fltNanEncoding` enum. We treat all NaNs as quiet, as the available
   // encodings do not distinguish between signalling and quiet NaN.
   NanOnly,
+
+  // This behavior is present in Float6E3M2FN and Float6E2M3FN types.
+  // There is no representation for Inf or NaN.
+  NoNanInf,
----------------
durga4github wrote:

Updated the comment in the latest revision.

For the naming:
The MX spec has a few other types but they support either Inf or Nan. So, I could not name it generically like "MXType".

I see that "inverting" (and naming) would change the condition-checks in the code.
Looking at the places where this is being used (in OR with other conditions), it gives better readability if we do not invert.

So, below are a few options that I could think of:
1) Finite
2) FiniteOnly
3) NoNanInf (current)
4) NoNanNoInf
5) SupportsNonFinite (if we strongly prefer inverted conditions and this naming)

Please let me know which one looks more reasonable.

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


More information about the cfe-commits mailing list