[PATCH] D61390: [CodeGen] Add lround/llround builtins

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 22:38:48 PDT 2019


craig.topper added inline comments.


================
Comment at: llvm/docs/LangRef.rst:12354
+This is an overloaded intrinsic. You can use ``llvm.lround`` on any
+floating-point. Not all targets support all types however.
+
----------------
Add 'type' after 'floating-point'.


================
Comment at: llvm/docs/LangRef.rst:12395
+This is an overloaded intrinsic. You can use ``llvm.llround`` on any
+floating-point. Not all targets support all types however.
+
----------------
floating-point type.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:2150
+/// lround and its variant).
+SDValue SelectionDAGLegalize::ExpandArgFPLibCall(SDNode* Node, bool isSigned,
+                                                 RTLIB::Libcall Call_F32,
----------------
Drop the isSigned argument like ExpandFPLibCall


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:775
   case ISD::FP_TO_UINT:  Res = SoftenFloatOp_FP_TO_XINT(N); break;
+  case ISD::LROUND:      Res = SoftenFloatOp_LROUND(N); break;
   case ISD::SELECT:      Res = SoftenFloatOp_SELECT(N); break;
----------------
Why is only LROUND handled here? Shouldn't the floating point handling need to be the same regardless of the integer type?


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

https://reviews.llvm.org/D61390





More information about the llvm-commits mailing list