[PATCH] D112025: Intrinsic for checking floating point class

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 21 11:35:15 PDT 2022


efriedma added inline comments.


================
Comment at: llvm/docs/LangRef.rst:22458
++-------+----------------------+
+| 1     | Quite NaN            |
++-------+----------------------+
----------------
*Quiet


================
Comment at: llvm/docs/LangRef.rst:22466
++-------+----------------------+
+| 5     | Nerative zero        |
++-------+----------------------+
----------------
*Negative


================
Comment at: llvm/docs/LangRef.rst:22485
+if the element value satisfies the specified test. The function never raises
+floating point exceptions.
+
----------------
Maybe give an example here, e.g. 0x104 tests for a normal number.

Is there some reason the bits are arranged in this particular order?  Not that I really have a better suggestion.


================
Comment at: llvm/include/llvm/IR/Intrinsics.td:734
+                            [llvm_anyfloat_ty, llvm_i32_ty],
+                            [IntrNoMem, IntrWillReturn]>;
+
----------------
Did you mean to add `ImmArg<ArgIndex<1>>`?


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:7269
+      return DAG.getSetCC(DL, ResultVT, Op, Op,
+                          IsInverted ? ISD::SETO : ISD::SETUO);
+  }
----------------
You could try to handle more cases here, e.g. fcPosNormal is two comparisons.  Not sure how worthwhile that is.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112025/new/

https://reviews.llvm.org/D112025



More information about the llvm-commits mailing list