[PATCH] D87115: [FPEnv][X86][SystemZ] Use different algorithms for i64->double uint_to_fp under strictfp to avoid producing -0.0 when rounding toward negative infinity

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 14:45:24 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:2440
+      (SrcVT == MVT::i64 && DestVT == MVT::f64)) {
+    LLVM_DEBUG(dbgs() << "Converting unsigned i32/i64 to f32/f64\n");
     // For unsigned conversions, convert them to signed conversions using the
----------------
efriedma wrote:
> efriedma wrote:
> > What types is this correct for?  I guess the integer type has to be larger than the mantissa by some number of bits, so the divide by 2 doesn't affect the rounding?
> I'd like to see a comment briefly describing the widths where this works.
Comment looks right.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87115



More information about the llvm-commits mailing list