[llvm] [LLParser] Support identifiers like `qnan` and `pinf` for special FP values (PR #102790)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 16:49:01 PDT 2024


================
@@ -4426,6 +4425,21 @@ represented by ``0xH`` followed by 4 hexadecimal digits. The bfloat 16-bit
 format is represented by ``0xR`` followed by 4 hexadecimal digits. All
 hexadecimal formats are big-endian (sign bit at the left).
 
+Some of the special floating point values can be represented by the following
+identifiers:
+
+    +-----------+---------------------------------------------------+
+    | Name      | Description                                       |
+    +===========+===================================================+
+    | ``qnan``  | Positive quiet NaN w/ payload equals to zero      |
+    +-----------+---------------------------------------------------+
+    | ``snan``  | Positive signaling NaN w/ payload equals to zero  |
----------------
mshockwave wrote:

Yeah it's a bit tricky to describe what we want here...maybe we could just say "value equal to APFloat::getSNaN()"? Though I'm not sure if we should rely on an API, which is subject to change anytime, to describe a specification. What do you think?

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


More information about the llvm-commits mailing list