[llvm] [DAG] Lower frem of power-2 using div/trunc/mul+sub (PR #91148)

David Green via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 06:08:34 PDT 2024


================
@@ -2111,6 +2115,10 @@ class SelectionDAG {
   /// Test whether the given SDValue is known to contain non-zero value(s).
   bool isKnownNeverZero(SDValue Op, unsigned Depth = 0) const;
 
+  /// Test whether the given float value is known to be positive. +0.0, +inf and
+  /// +nan are considered positive, -0.0, -inf and -nan are not.
+  bool isKnownPositiveOrNaNFP(SDValue Op) const;
----------------
davemgreen wrote:

I see, The IEEE 754 standard specifies that the sign bit of a NaN has no significance. The Arm architecture is obviously more opinionated about what the correct answer is, and I have been testing bitwise.

That probably helps with copysign too. I can change it to the new name.

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


More information about the llvm-commits mailing list