[PATCH] D69275: Add constrained int->FP intrinsics

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 10:18:47 PST 2019


uweigand added a comment.

I've looked over the common code changes again, and they now look good to me.   I'll leave it to Craig to review the X86 changes ...



================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:178
   SDValue PromoteLegalINT_TO_FP(SDValue LegalOp, EVT DestVT, bool isSigned,
                                 const SDLoc &dl);
   void PromoteLegalFP_TO_INT(SDNode *N, const SDLoc &dl,
----------------
kpn wrote:
> uweigand wrote:
> > Hmm, wouldn't we also need to update this routine?  Or can we say that promotion is not appropriate for handling strict semantics anyway?
> I don't have a test for it so I didn't change it.
> 
> Can we guarantee the result would be rounded back down? Seems like promotion would be invalid without that guarantee.
Right.  In general promotion is not appropriate for strict semantics because you don't get the right exceptions (for overflow etc.).


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:2403
     // final result
-    SDValue Result = DAG.getFPExtendOrRound(Sub, dl, DestVT);
+    SDValue Result, NewChain;
+    if (Node->isStrictFPOpcode()) {
----------------
NewChain seems superfluous?


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

https://reviews.llvm.org/D69275





More information about the llvm-commits mailing list