[PATCH] D84287: [SelectionDAG] Make LegalizeDAG lower FNEG using integer ops.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 16:34:41 PDT 2020


efriedma added a comment.

Do you think the globalisel change has to be done in the same patch?  I guess I can try to look into it.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1574
+  // Expand using integer operations. (We used to expand to FSUB, but that's
+  // not correct in cases involving NaNs.)
+  SDLoc DL(Node);
----------------
arsenm wrote:
> The explanation is too vague and not quite correct. It's specifically signaling nans (and also possibly denormal flushing). fsub is a canonicalizing operation, but fneg is not
There's also a problem for non-signalling nans: the sign of the result is unspecified.  Maybe common implementations flip the sign?  Not sure.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84287



More information about the llvm-commits mailing list