[llvm] [AsmParser] Revamp how floating-point literals work in LLVM IR. (PR #190641)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 02:41:57 PDT 2026


================
@@ -1404,7 +1404,25 @@ class APFloat : public APFloatBase {
     APFLOAT_DISPATCH_ON_SEMANTICS(convertFromAPInt(Input, IsSigned, RM));
   }
 
-  LLVM_ABI Expected<opStatus> convertFromString(StringRef, roundingMode);
+  /// Fill this APFloat with the result of a string conversion.
+  ///
+  /// The following strings are accepted for conversion purposes:
+  /// * Decimal floating-point literals (e.g., `0.1e-5`)
+  /// * Hexadecimal floating-point literals (e.g., `0x1.0p-5`)
+  /// * Positive infinity via "inf", "INFINITY", "Inf", "+Inf", or "+inf".
+  /// * Negative infinity via "-inf", "-INFINITY", or "-Inf".
+  /// * Quiet NaNs via "nan", "NaN", "nan(...)", or "NaN(...)", where the
+  ///   "..." is either a decimal or hexadecimal integer representing the
+  ///   payload. A negative sign may be optionally provided.
+  /// * Signaling NaNs via "snan", "sNaN", "snan(...)", or "sNaN(...)", where
+  ///   the "..." is either a decimal or hexadecimal integer representing the
----------------
jayfoad wrote:

decimal is no longer supported?

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


More information about the llvm-commits mailing list