[llvm] [KnownFPClass] Fix input/output subnormal handling for `propagateXorSign` (PR #219837)

Eric Ross via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 13 09:58:38 PDT 2026


================
@@ -150,6 +150,18 @@ struct KnownFPClass {
     return isKnownNever(fcPositive) && isKnownNeverLogicalNegZero(Mode);
   }
 
+  /// Return true if this cannot have a non-NaN positive value when interpreted
+  /// as an input under \p Mode.
+  bool cannotHavePositiveValue(DenormalMode Mode) const {
----------------
ZERICO2005 wrote:

`signBitMustBeZero`/`signBitMustBeOne` includes `NaN` classes. Here we are only interested in non-`NaN` classes, and in particular whenever a negative subnormal could flush to positive zero.

The other main difference here is that `cannotBeOrderedLessThanZero` treats `+0.0` and `-0.0` the same, while `cannotHavePositiveValue`/`cannotHaveNegativeValue` treat `+0.0` and `-0.0` differently.

I could also rename it to `cannotHavePositiveInput`/`cannotHaveNegativeInput`.


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


More information about the llvm-commits mailing list