[clang] [llvm] Option to control signaling NaN support (PR #193055)

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 24 09:46:08 PDT 2026


================
@@ -2574,6 +2574,14 @@ For example:
 ``sanitize_alloc_token``
     This attribute indicates that implicit allocation token instrumentation
     is enabled for this function.
+``signaling-nans``
+    If a function has this attribute, signaling NaNs are assumed to be treated
+    according to IEEE 754 rules. That is, signaling NaN values are quieted in
+    arithmetic operations, and the floating-point exception ``Invalid`` is
+    raised if an operand of such an operation is a signaling NaN. If this
+    attribute is absent, signaling NaNs are assumed to be treated identically to
+    quiet NaNs. This attribute cannot be set if the target architecture does not
+    support IEEE 754 compatible signaling NaN handling.
----------------
spavloff wrote:

It is an interesting example, thank you.

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


More information about the cfe-commits mailing list