[llvm] [llvm] `APFloat`: Query `hasNanOrInf` from semantics (PR #116158)
Matthias Springer via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 14 03:43:45 PST 2024
================
@@ -1127,19 +1129,11 @@ class APFloat : public APFloatBase {
/// \param Semantics - type float semantics
static APFloat getAllOnesValue(const fltSemantics &Semantics);
- /// Returns true if the given semantics supports either NaN or Infinity.
+ /// Returns true if the given semantics supports NaN or Infinity.
///
/// \param Sem - type float semantics
static bool hasNanOrInf(const fltSemantics &Sem) {
- switch (SemanticsToEnum(Sem)) {
- default:
- return true;
- // Below Semantics do not support {NaN or Inf}
- case APFloat::S_Float6E3M2FN:
- case APFloat::S_Float6E2M3FN:
- case APFloat::S_Float4E2M1FN:
- return false;
- }
----------------
matthias-springer wrote:
I moved the function to `APFloatBase` next to `semanticsHasZero` etc.
https://github.com/llvm/llvm-project/pull/116158
More information about the llvm-commits
mailing list