[PATCH] D139785: [InstCombine] preserve signbit semantics of NAN with fold to fabs

Ralf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 11 09:23:23 PST 2022


RalfJung added a comment.

> Comparisons don't look at the sign of NaN. They are not bitwise operations like fabs/fneg.

Yeah, and hence `-NaN > 0.0` is `false`, so that's what I said, no?

My confusion is with this comment

  // Note: This requires nnan to preserve signbit semantics even though the
  //       signbit of a NAN is insignificant.

since "signbit of a NAN is insignificant" is not correct in general.

I would be less confused by something like

  // Note: This requires nnan to preserve signbit semantics since fcmp ignores
  //       the signbit of a NAN.


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

https://reviews.llvm.org/D139785



More information about the llvm-commits mailing list